diff --git a/src/Protocols/SmtpProtocol.php b/src/Protocols/SmtpProtocol.php index c239b65..0e637a9 100644 --- a/src/Protocols/SmtpProtocol.php +++ b/src/Protocols/SmtpProtocol.php @@ -45,7 +45,7 @@ public function __construct(Spool $spool) $this->config = $this->spool->getConfig(); - if ( ! $this->config->offsetExists('debug')) { + if ( ! isset($this->config['debug'])) { /** * Debug output level. * Options: @@ -58,7 +58,7 @@ public function __construct(Spool $spool) $this->config[ 'debug' ] = 0; } - if ( ! $this->config->offsetExists('auth')) { + if ( ! isset($this->config['auth'])) { $this->config[ 'auth' ] = false; if ( ! empty($this->config[ 'username' ])) { $this->config[ 'auth' ] = true; @@ -98,11 +98,12 @@ protected function sending(Message $message) $phpMailer->AuthType = $this->config['auth']; } - $phpMailer->Username = $this->config[ 'username' ]; - $phpMailer->Password = $this->config[ 'password' ]; $phpMailer->SMTPSecure = $this->config[ 'encryption' ]; $phpMailer->Port = $this->config[ 'port' ]; + $phpMailer->Username = $this->config[ 'username' ]; + $phpMailer->Password = $this->config[ 'password' ]; + // Set from if (false !== ($from = $message->getFrom())) { $phpMailer->setFrom($from->getEmail(), $from->getName()); diff --git a/src/Spool.php b/src/Spool.php index d0189ba..c355326 100644 --- a/src/Spool.php +++ b/src/Spool.php @@ -64,7 +64,7 @@ public function __construct(Config $config = null) */ public function send(Message $message) { - $protocolClass = '\O2System\Email\Protocols\\' . ucfirst($this->config->offsetGet('protocol')) . 'Protocol'; + $protocolClass = '\O2System\Email\Protocols\\' . ucfirst($this->config['protocol']) . 'Protocol'; if (class_exists($protocolClass)) { $protocol = new $protocolClass($this);