Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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

Discussion in 'E-mail Discussion' started by ASLAN OZCAKIR, Sep 21, 2017.

  1. Aslan Ozcakir

    Aslan Ozcakir Registered

    Joined:
    Sep 21, 2017
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    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
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,633
    Likes Received:
    1,787
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Carlo Prati

    Carlo Prati Registered

    Joined:
    Nov 30, 2017
    Messages:
    1
    Likes Received:
    2
    Trophy Points:
    1
    Location:
    italy
    cPanel Access Level:
    Root Administrator
    I solved using this tips

    > CSF firewall configuration
    > smtp setting
    > whitelist users in variable "SMTP_ALLOWUSER

    smtp_allowuser : cpanel,myuser

    ( user is ftp login domain )

    Gmail SMTP work fine for me now !
     
    MajorLancelot and cPanelMichael like this.
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,633
    Likes Received:
    1,787
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm glad to see you were able to solve the issue. Thank you for updating us with the outcome.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice