SOLVED PHP Mailer with Gmail SMTP works one day and stops the next day

Aslan Ozcakir

Registered
Sep 21, 2017
1
0
0
Istanbul
cPanel Access Level
Root Administrator
Hello,

I have an issue with sending emails using PHPMailer + Gmail SMTP:

I have exactly the same code from PHPMailer using smtp.gmail.com and 587 port with TLS.
When I do a grace reboot and run the script it works fine and sends the email immediately without an issue. (I am also testing it with smtp.yandex.com it works as well).

However, the next day when I run the same script I got "SMTP connect () failed." error.

Any ideas how to debug this issue? I do not want to reboot the server everyday.

Thanks in advance for your suggestions.
Sincerely,
Aslan Ozcakir
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,213
363
However, the next day when I run the same script I got "SMTP connect () failed." error.
Hello,

Is "WHM Home » Security Center » SMTP Restrictions" enabled on this system, or is the "SMTP_BLOCK" option enabled in your CSF configuration (if CSF is installed)?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,213
363
Hello,

I'm glad to see you were able to solve the issue. Thank you for updating us with the outcome.