Skip to content

Commit

Permalink
email authentication bugs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
steevenz committed Aug 23, 2020
1 parent fae833a commit cbb937a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/Protocols/SmtpProtocol.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
Expand Down Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/Spool.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cbb937a

Please sign in to comment.