VDV*_*eon 24 php authentication smtp swiftmailer
当我将带有PHP Swift邮件程序的电子邮件发送到此服务器时:smtp.exchange.example.com如下:
// 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);
我收到一个奇怪的错误:
无法使用2个可能的身份验证器在用户名为"user@example.com"的SMTP服务器上进行身份验证
我确定登录信息是正确的.
ron*_*neo 31
这可能是旧的,但有人可能会得到帮助.我也面临同样的问题,并在我的Gmail帐户上收到一封邮件,说明有人试图通过电子邮件客户端或其他网站破解您的帐户.我搜索过,发现下面这样做可以解决这个问题.
转到https://accounts.google.com/UnlockCaptcha并解锁您的帐户,以便通过其他媒体/网站进行访问.
更新:2015年
此外,您可以尝试此操作,请访问https://myaccount.google.com/security#connectedapps 在底部,右侧有一个选项"允许安全性较低的应用".如果是"OFF",请通过滑动按钮将其打开.
Min*_*int 10
我遇到了同样的问题,所以我在WHM root登录中禁用了一个设置,如下所示:
WHM>主页>服务器配置>调整设置>将外发SMTP限制为root,exim和mailman(FKA SMTP Tweak)[?]
小智 6
我真的有同样的问题,最后,我解决了它.
它不像Swift Mail的问题.这是Yaml解析器的问题.如果你的密码只有数字,那么密码最终会迅速变为不同的密码.
swiftmailer:
    transport:  smtp
    encryption: ssl
    auth_mode:  login
    host:       smtp.gmail.com
    username:   your_username
    password:   61548921
你需要用双引号密码修复它:"61548921"