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 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单