The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I can not send e-mail by SMTP

Discussion in 'E-mail Discussions' started by Diego Marquez, Aug 30, 2016.

  1. Diego Marquez

    Diego Marquez Member

    Joined:
    Aug 13, 2015
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    cPanel Access Level:
    Website Owner
    I am sending mail using phpmailer with google apps.

    The error appears to me is:

    SMTP ERROR: Failed to connect to server: Network is unreachable (101) 2016-08-30 23:09:33 SMTP connect() failed.

    Code:
    $mail->Host = "smtp.gmail.com";
    $mail->SMTPAuth = true;
    $mail->SMTPSecure = 'ssl';
    $mail->Port=465;


    I made no change in the code and the server.

    No have firewall.
     
  2. ruzbehraja

    ruzbehraja Well-Known Member

    Joined:
    May 19, 2011
    Messages:
    383
    Likes Received:
    7
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Have you tried pinging smtp.gmail.com ?? Does it work?

    Seems like a connectivity issue between your server / ISP and gmail.

    Nothing to do with cPanel mostly.
     
  3. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,146
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello :),

    There is an issues with the firewall. Please try to disabled your server firewall and your script again.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Your access level is listed as "Website Owner". Do you have root access to this system? If not, please report this issue to your web hosting provider, as it's possible new firewall rules were added or changes to the "WHM >> SMTP Restrictions" option were made.

    Thank you.
     
  5. Diego Marquez

    Diego Marquez Member

    Joined:
    Aug 13, 2015
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    cPanel Access Level:
    Website Owner
    Yes, I have root access.

    "SMTP Restrictions" this disable.

    You do not have the server firewall.

    It seems that the port 465 and 587 blocked ...

    Any other suggestions?

    thanks
     
  6. NOC_Serverpoint

    NOC_Serverpoint Active Member

    Joined:
    Jul 3, 2016
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    You have to determine whether it's a network problem; or issues with PHP mailer or your code.
    On your server, from a command prompt, try using telnet to connect to smtp.gmail.com on port 587 and 465, like so:

    telnet smtp.gmail.com 587

    You should see a response from smtp.gmail.com as Connected.
    If the connection attempt hang and eventually time out it could mean that your hosting company is blocking outgoing SMTP connections on port 587 and 465
     
  7. Diego Marquez

    Diego Marquez Member

    Joined:
    Aug 13, 2015
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    cPanel Access Level:
    Website Owner
    The problem was solved.

    The server network was in trouble.
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  9. Webile Technologies

    Webile Technologies Registered

    Joined:
    Jul 12, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ahmedabad
    cPanel Access Level:
    Website Owner
    In some cases a simple request to your ISP will get them to unblock Port 25 for you, or sometimes simply using Port 587 for your SMTP will work, but in some cases your ISP may instead require you to use their SMTP server setting for outgoing mail.
     
Loading...

Share This Page