【发布时间】:2016-06-01 09:38:30
【问题描述】:
我已经在 env 中为我的邮件服务器设置了配置
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=25
MAIL_USERNAME=xxxxxxxx
MAIL_PASSWORD=xxxxxxxx
MAIL_ENCRYPTION=null
它在我的本地服务器上运行良好。但是当我在我的生产服务器上测试它时,它不再工作了。 我还尝试修改我的 iptables 以允许端口连接
# Generated by iptables-save v1.4.18 on Fri Feb 19 14:47:25 2016
*filter
:INPUT ACCEPT [72:5432]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [53:7392]
-A INPUT -p tcp -m tcp --dport 25 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 110 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 995 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 143 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 993 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 1080 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 1025 -j ACCEPT
COMMIT
但没有好处。每当我尝试发送测试电子邮件时,它仍然显示未建立连接。
然后我尝试 telnet 并超时
[root@root laravel5]# telnet mailtrap.io 25
Trying 52.20.34.166...
telnet: connect to address 52.20.34.166: Connection timed out
Trying 52.22.93.185...
telnet: connect to address 52.22.93.185: Connection timed out
Trying 52.5.202.66...
telnet: connect to address 52.5.202.66: Connection timed out
什么可能导致这种情况?有人可以帮我吗?非常感谢。
【问题讨论】:
-
很多主机、isp等阻塞了25端口。你试过465端口还是2525端口?
-
是的,我确实使用了端口 465 和 2525,但仍然无法使用。