I have already set up my config in env for my mail server
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=25
MAIL_USERNAME=xxxxxxxx
MAIL_PASSWORD=xxxxxxxx
MAIL_ENCRYPTION=null
It works fine in my local server. But when I test it on my production server, it doesn't work any more. I also tried modifying my iptables to allow the port connections
# 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
But to no good. It still says Connection not established whenever I try to send a test email.
Then I tried to telnet and it timeouts
[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
What could cause this? Can anybody help me on this? Thank you sooo much.