diff --git a/config/mail.php b/config/mail.php index 97f452356..10be8534c 100644 --- a/config/mail.php +++ b/config/mail.php @@ -93,11 +93,12 @@ | Auth mode |-------------------------------------------------------------------------- | - | 'login' or 'XOAUTH2' + | This option have an effect when set to 'XOAUTH2' only. + | In other cases Swiftmailer chooses auth mode automatically. | */ - 'auth_mode' => env('MAIL_AUTH_MODE', 'login'), + 'auth_mode' => env('MAIL_AUTH_MODE', ''), /* |-------------------------------------------------------------------------- diff --git a/overrides/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php b/overrides/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php index 9ec539c6f..3164e11a6 100644 --- a/overrides/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php +++ b/overrides/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php @@ -27,7 +27,7 @@ class Swift_SmtpTransport extends Swift_Transport_EsmtpTransport * @param int $port * @param string $encryption */ - public function __construct($host = 'localhost', $port = 25, $encryption = null, $auth_mode = 'login') + public function __construct($host = 'localhost', $port = 25, $encryption = null, $auth_mode = '') { parent::__construct(...Swift_DependencyContainer::getInstance()->createDependenciesFor('transport.smtp')); // call_user_func_array( @@ -39,6 +39,8 @@ public function __construct($host = 'localhost', $port = 25, $encryption = null, $this->setHost($host); $this->setPort($port); $this->setEncryption($encryption); - $this->setAuthMode($auth_mode); + if ($auth_mode == 'XOAUTH2') { + $this->setAuthMode($auth_mode); + } } }