. class Email extends Secrets { // E-mail delivery method class protected $mailer; public function __construct (Setup $setup) { // Name of mailer class to instantiate $mail_class = 'HashOver\\' . $setup->mailer; // Instantiate mailer class $this->mailer = new $mail_class ($setup); // Setup SMTP Mailer if (mb_strtolower ($setup->mailer) !== 'sendmail') { // Set SMTP server host $this->mailer->setHost ($this->smtpHost); // Set SMTP server port number $this->mailer->setPort ($this->smtpPort); // Set SMTP server encryption method $this->mailer->setCrypto ($this->smtpCrypto); // Set whether SMTP server requires authentication $this->mailer->setAuth ($this->smtpAuth); // Set SMTP server login user $this->mailer->setUser ($this->smtpUser); // Set SMTP server login password $this->mailer->setPassword ($this->smtpPassword); } } // Call mailer method public function to ($email, $name = null) { $this->mailer->to ($email, $name); } // Call mailer method public function from ($email, $name = null) { $this->mailer->from ($email, $name); } // Call mailer method public function subject ($text) { $this->mailer->subject ($text); } // Call mailer method public function replyTo ($email, $name = null) { $this->mailer->replyTo ($email, $name); } // Call mailer method public function text ($text) { $this->mailer->text ($text); } // Call mailer method public function html ($html) { $this->mailer->html ($html); } // Call mailer method public function send () { $this->mailer->send (); } }