When I send an email with the PHP Swift mailer to this server: smtp.exchange.example.com like this:
// Load transport
$this->transport =
Swift_SmtpTransport::newInstance(
self::$config->hostname,
self::$config->port
)
->setUsername(self::$config->username)
->setPassword(self::$config->password)
;
// Load mailer
$this->mailer = Swift_Mailer::newInstance($this->transport);
// Initialize message
$this->message = Swift_Message::newInstance();
// From
$this->message->setFrom(self::$config->from);
// Set message etc. ...
// Send
$this->mailer->send($this->message);
I get a strange error back:
Failed to authenticate on SMTP server with username "[email protected]" using 2 possible authenticators
I know for sure that the login-info is correct.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…