Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Class GEmailLogRoute
- */
- class GEmailLogRoute extends CLogRoute
- {
- public $port = 465;
- public $host;
- public $smtpAuth = true;
- public $smtpSecure = 'SSL';
- public $isHtml = true;
- public $username;
- public $password;
- public $to = [];
- /**
- * @param $email
- * @param $subject
- * @param $body
- */
- protected function sendEmail($email, $subject, $body)
- {
- $mailer = Yii::createComponent('application.extensions.mailer.EMailer');
- $mailer->IsSMTP();
- $mailer->Host = $this->host;
- $mailer->SMTPAuth = $this->smtpAuth;
- $mailer->SMTPSecure = $this->smtpSecure;
- $mailer->isHTML($this->isHtml);
- $mailer->Port = $this->port;
- $mailer->Username = $this->username;
- $mailer->From = $this->username;
- $mailer->FromName = $this->username;
- $mailer->AddReplyTo($this->username);
- $mailer->Password = $this->password;
- $mailer->AddAddress($email);
- $mailer->CharSet = 'UTF-8';
- $mailer->Subject = $subject;
- $mailer->Body = $body;
- $mailer->Send();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement