SMTP ERROR: Failed to connect to server: (0)

0

I'm using AWS Elastic Beanstalk and I can not send mail with PHPMailer. On my local server it works perfectly with exactly the same configuration. AWS Elastic Beanstalk uses Red Hat 4.8.3-9 ... I've tried all PHPMailer troubleshooting techniques and all are working normally. The only one that leaves me doubting is the SELinux blocking that I do not know if it will be a problem, but anyway the error is not the same.

I tried to use the command getsebool httpd_can_sendmail and the response was this getsebool: SELinux is disabled .

The PHPMailer error:

  

SMTP ERROR: Failed to connect to server: (0)

Is this the problem? Does anyone know how to solve it?

Cross Post: link
Issue: link

    
asked by anonymous 23.03.2017 / 22:15

1 answer

1

"SMTP ERROR: Failed to connect to server: (0)" means that there was no connection to the SMTP server, this means that there is a connection block, please review the following questions:

  • Make sure the host or ip address is valid;
  • Make sure that the inserted port and authentication form are correct; (typically 587 without TLS / SSL or 465 if TLS / SSL is supported)
  • Make sure your local or remote firewall is NOT blocking the connections, so it is feasible to review the rules of both the firewall
  • Ensure that the SMTP server allows an external connection, some providers block external connections;
22.06.2017 / 10:34