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

Asked

Viewed 3,461 times

1

I’m using AWS Elastic Beanstalk and I can’t send mails with Phpmailer. On my local server it works right with exactly the same configuration. AWS Elastic Beanstalk uses Red Hat 4.8.3-9... I tried all problem solving techniques of Phpmailer and they’re all functioning normally. The only one that leaves me doubt is the "Selinux blocking" that I do not know if it will be a problem, but anyway the error is not even the same.

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

The error of Phpmailer:

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

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

Cross Post: https://stackoverflow.com/q/42983283/1817673
Issue: https://github.com/PHPMailer/PHPMailer/issues/1013

  • Subnet has internet gateway?

  • @juniorb2ss subnet from where?

1 answer

2


"SMTP ERROR: Failed to connect to server: (0)" means there was no connection to the SMTP server, it means there is a connection lock, review the following issues:

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.