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.

SMTP email delivery method in site software on my server doesn't work

Discussion in 'E-mail Discussions' started by Archmactrix, Nov 25, 2013.

  1. Archmactrix

    Archmactrix Well-Known Member

    Joined:
    Jan 20, 2012
    Messages:
    132
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Choosing SMTP as email delivery method in forum software settings gives this error:

    Code:
    Could not open a socket to the SMTP server (0:php_network_getaddresses: getaddrinfo failed: Name or service not known)
    But the mail gets sent if I choose PHP mail method instead.

    This is a new installation of the forum software on a fresh cPanel account. Using SMTP in this same forum software worked before on another server I had.

    I have root access to the server.
     
    #1 Archmactrix, Nov 25, 2013
    Last edited: Nov 25, 2013
  2. MikeDVB

    MikeDVB Well-Known Member
    PartnerNOC

    Joined:
    Jun 4, 2008
    Messages:
    212
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Indiana, USA
    Have you tried using 'localhost' as the SMTP server hostname and making sure that you created the email account/password combination that you're trying to use?
     
  3. Archmactrix

    Archmactrix Well-Known Member

    Joined:
    Jan 20, 2012
    Messages:
    132
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    SMTP host is set as localhost in the forum settings, but I'm not using password in the same settings and have never needed to do before.

    But I find it strange that in the cPanel email settings for the account, I'm supposed to use the cPanel password for the user but not the email account password like I do in my other cPanel accounts on the server.

    cpanel_email_account_settings.png
     
  4. MikeDVB

    MikeDVB Well-Known Member
    PartnerNOC

    Joined:
    Jun 4, 2008
    Messages:
    212
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Indiana, USA
    You will want to create an email account via cPanel -> Email Accounts. The 'default' mail account is not designed to be used for what you're trying to use it.

    Once you add the email account - you'll use it's email address as the username and it's password as the password.
     
  5. Archmactrix

    Archmactrix Well-Known Member

    Joined:
    Jan 20, 2012
    Messages:
    132
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Of course I'm not using the default mail account. I have already created an email account and it's working.
     
  6. MikeDVB

    MikeDVB Well-Known Member
    PartnerNOC

    Joined:
    Jun 4, 2008
    Messages:
    212
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Indiana, USA
    You're the one that brought up the cPanel username and password - not me :).

    Sounds to me like your issue is resolved, no?
     
  7. Archmactrix

    Archmactrix Well-Known Member

    Joined:
    Jan 20, 2012
    Messages:
    132
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    The issue is not resolved.

    I just mentioned that in the email account settings in cPanel, I'm asked to provide the cPanel password when configuring an email client, just like the image shows. But I'm using the same email account in an email client, and using the email account password.
     
  8. MikeDVB

    MikeDVB Well-Known Member
    PartnerNOC

    Joined:
    Jun 4, 2008
    Messages:
    212
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Indiana, USA
    I'm not sure how you're getting it to display that but, that said, this is what I see when I check any email account in my personal cPanel account [some information redacted]:
    /http://www.screen-shot.net/2013-11-25_19-06-12.png
     
  9. Archmactrix

    Archmactrix Well-Known Member

    Joined:
    Jan 20, 2012
    Messages:
    132
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Yes I see this also in two of my cPanel user accounts but not the one I'm hosting the forum software I mentioned.

    I created that cPanel account yesterday, and an email account and it's password. The email address is working, but when choosing SMTP as the email delivery method in the forum settings for that email address, I get the error I first mentioned.

    But PHP Mail works though as the delivery method and the email is sent and received.

    When checking the email account settings for that newly created cPanel user I see that I should use the cPanel password for the email account when configuring an email client, but that is strange.

    The email account works though with it's own password.
     
  10. MikeDVB

    MikeDVB Well-Known Member
    PartnerNOC

    Joined:
    Jun 4, 2008
    Messages:
    212
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Indiana, USA
    The error you reported:
    Code:
    Could not open a socket to the SMTP server (0:php_network_getaddresses: getaddrinfo failed: Name or service not known)
    This looks like a DNS Resolution issue. If you're using 'localhost' then you can try '127.0.0.1' instead [since that doesn't need a DNS resolver to work, or an accurate setting in the hosts file].
     
  11. Archmactrix

    Archmactrix Well-Known Member

    Joined:
    Jan 20, 2012
    Messages:
    132
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Yes that worked thank you very much.
     
  12. MikeDVB

    MikeDVB Well-Known Member
    PartnerNOC

    Joined:
    Jun 4, 2008
    Messages:
    212
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Indiana, USA
    Sure.

    You may want to open /etc/hosts and add this line:
    Code:
    127.0.0.1	localhost
     
  13. Archmactrix

    Archmactrix Well-Known Member

    Joined:
    Jan 20, 2012
    Messages:
    132
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    I have that already in the hosts file.

    Code:
    127.0.0.1               localhost.localdomain localhost localhost4
    # Auto-generated hostname. Please do not remove this comment.
    xx.xxx.xxx..x            server.mydomain.com server localhost6 localhost6.localdomain6 localhost.localdomain
    ::1             localhost
     
Loading...

Share This Page