【问题标题】:Laravel - Failed to authenticate on SMTP server with .. using 2 possible authenticatorsLaravel - 无法使用 .. 使用 2 个可能的身份验证器在 SMTP 服务器上进行身份验证
【发布时间】:2018-05-30 21:57:26
【问题描述】:

我看到这个问题被问了很多次。我尝试了很多,但没有任何效果。我正在使用 laravel 和 mailgun api 发送电子邮件。

我收到此错误Failed to authenticate on SMTP server with username "postmaster@noreplay.padelmatch.se" using 2 possible authenticators 并且在我的专用服务器日志中我也收到了

2018-05-30 13:37:32 dovecot_login authenticator failed for 
(domain.com) [198.20.114.174]:40412: 535 Incorrect authentication 
data (set_id=email@sub.subdomain.com)

2018-05-30 13:37:38 SMTP connection from (domain.com) 
[198.20.114.174]:40412 lost

我还创建了一个同名的电子邮件帐户 (email@sub.subdomain.com),但仍然无法使用。

在我的 .env 文件中,我有这样的设置

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=25
MAIL_USERNAME=email@sub.domain.com
MAIL_PASSWORD=xxxxxxx
MAILGUN_SECRET=xxxxxxx
MAILGUN_DOMAIN=sub.domain.com
MAIL_ENCRYPTION=null

知道如何解决吗?

谢谢。

【问题讨论】:

  • 我在mailgun中使用了587端口...你使用https连接吗?
  • 没有。只有http连接

标签: laravel laravel-5 swiftmailer mailgun


【解决方案1】:

我解决了。其实这是一件愚蠢的事情。由于我使用的是 mailgun,所以我不需要使用 smpt,因为它会导致问题。所以在邮件驱动程序中,我使用了 MAIL_DRIVER=mailgun,这就是我的案例的解决方案:)。希望它可以帮助一些孤独的谷歌人......

【讨论】:

  • 它确实救了我!谢谢
  • 你能添加完整的配置吗?
猜你喜欢
  • 2018-01-13
  • 2019-10-06
  • 2021-06-11
  • 2019-01-20
  • 1970-01-01
  • 1970-01-01
  • 2020-12-21
  • 2019-10-02
  • 2019-09-16
相关资源
最近更新 更多