PHP Swift 邮件程序:无法使用 2 个可能的身份验证器在 SMTP 上进行身份验证 [英] PHP Swift mailer: Failed to authenticate on SMTP using 2 possible authenticators

查看:38
本文介绍了PHP Swift 邮件程序:无法使用 2 个可能的身份验证器在 SMTP 上进行身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用 PHP Swift 邮件程序向此服务器发送电子邮件时: smtp.exchange.example.com 如下所示:

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:

无法使用 2 个可能的身份验证器在用户名user@example.com"的 SMTP 服务器上进行身份验证

Failed to authenticate on SMTP server with username "user@example.com" using 2 possible authenticators

我确定登录信息是正确的.

I know for sure that the login-info is correct.

推荐答案

足够奇怪的发送电子邮件再次起作用.我们没有改变任何东西,主人说他们也没有.我们认为服务器重新启动左右.很奇怪:S

Strange enough sending emails works again. We did not change anything and the host say they did not either. We think a server restarts or so. It is strange :S

这篇关于PHP Swift 邮件程序:无法使用 2 个可能的身份验证器在 SMTP 上进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆