dongma2388 2018-04-23 14:17
浏览 56
已采纳

MailTrap没有在宅基地的Laravel上工作

I used to use MailTrap with Laravel just fine.

However, since I updated to Laravel 5.6 and updated to Homestead, I can't seem to send any mail using MailTrap.

Here is a snippet of how my .env file looks similar to:

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=XXX
MAIL_PASSWORD=XXX
MAIL_ENCRYPTION=null
MAIL_FROM_NAME="John Smith"
MAIL_FROM_ADDRESS=admin@foo.com

I have also cleared my config cache and re-cached it, as well as restarted the server.

Whenever, I try sending mail I get a Swift_TransportException with the message: Connection could not be established with host mailtrap.io [Connection timed out #110].

Why is this happening and how can I fix this issue.

  • 写回答

1条回答 默认 最新

  • dongxin8392 2018-04-23 14:43
    关注

    You need to change MAIL_HOST=mailtrap.io to MAIL_HOST=smtp.mailtrap.io because mailtrap.io is a deprecated url.

    You can read more there.

    On 8 March 2018 Mailtrap blocked the traffic from “mailtrap.io”.

    The Mailtrap users who signed up for Mailtrap before November 10th, 2016 and did not update their credentials have to make a slight change in the SMTP host address: add “smtp” to the current SMTP host name. So, instead of “mailtrap.io”, it will be called “smtp.mailtrap.io”

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line