示例#1
0
 /**
  * Initialize the Sender
  * 
  * @throws \Exception
  */
 public function init()
 {
     $api_key = $this->settings()->{'mandrill.api_key'};
     $smtp_host = $this->settings()->{'mandrill.smtp_host'};
     $smtp_port = $this->settings()->{'mandrill.smtp_port'};
     $smtp_username = $this->settings()->{'mandrill.smtp_username'};
     $smtp_password = $this->settings()->{'mandrill.smtp_password'};
     if ($api_key) {
         $this->Mailer = 'mandrill';
         $this->type = 'mandrill.api';
         $this->__api = new \Mandrill($api_key);
     } elseif ($smtp_host && $smtp_port && $smtp_username && $smtp_password) {
         $this->type = 'mandrill.smtp';
         $this->IsSMTP();
         $this->Host = $smtp_host;
         $this->Port = $smtp_port;
         $this->Username = $smtp_username;
         $this->Password = $smtp_password;
         $this->SMTPSecure = 'tls';
         $this->SMTPAuth = true;
     } else {
         throw new \Exception('Missing settings');
     }
     return parent::init();
 }
示例#2
0
 public function init()
 {
     $smtp_host = $this->settings()->{'smtp.smtp_host'};
     $smtp_port = $this->settings()->{'smtp.smtp_port'};
     $smtp_username = $this->settings()->{'smtp.smtp_username'};
     $smtp_password = $this->settings()->{'smtp.smtp_password'};
     if ($smtp_host && $smtp_port && $smtp_username && $smtp_password) {
         // since we extend PHPMailer, just send via SMTP
         $this->IsSMTP();
         $this->Host = $smtp_host;
         $this->Port = $smtp_port;
         $this->Username = $smtp_username;
         $this->Password = $smtp_password;
         // TODO Add config options for these
         $this->SMTPAuth = true;
         $this->SMTPSecure = 'tls';
     } else {
         throw new \Exception('Missing settings');
     }
     return parent::init();
 }
示例#3
0
 public function init()
 {
     $this->isSendmail();
     return parent::init();
 }