0
We were using phpmailer to send emails, but simply overnight the same is with a strange behavior not sending emails.
The error that occurs:
SMTP -> ERROR: Failed to connect to server: Network is unreachable (101)
The setting is this:
//Set the hostname of the mail server $mail->Host = '*****'; // use // $mail->Host = gethostbyname('smtp.gmail.com'); // if your network does not support SMTP over IPv6 $mail->SMTPAutoTLS = false; //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission $mail->Port = 587; //Set the encryption system to use - ssl (deprecated) or tls $mail->SMTPSecure = 'tls'; //Whether to use SMTP authentication $mail->SMTPAuth = true; //Username to use for SMTP authentication - use full email address for gmail $mail->Username = "[email protected]"; //Password to use for SMTP authentication $mail->Password = "*****";
All settings have been reviewed and all of them are correct.
Which server and port is using?
– Guilherme Nascimento
The
cocari.com.br
supports tls or ssl?– Guilherme Nascimento
Hello @Guilhermenascimento, yes, supports. TLS port 587
– adventistapr
The mistake
Network is unreachable
to say that the network is inaccessible, the host that used andcocari.com.br
orsmtp.cocari.com.br
ormail.cocari.com.br
?– Guilherme Nascimento
Try the command on Windows CMD something similar to this
telnet smtp.cocari.com.br 587
, change smtp.cocari.com.br to your smtp host and tell me the result. Which hosting is using?– Guilherme Nascimento
The host used: mail.cocari.com.br we are using our own hosting.
– adventistapr
Why telnet is connecting right.
– adventistapr
Your server and Windowsserver?
– Guilherme Nascimento
Report to the network administrator a possible firewall lock on port 587, I think maybe this is the problem.
– Guilherme Nascimento