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

Archmactrix

Well-Known Member
Jan 20, 2012
138
2
68
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.
 
Last edited:

MikeDVB

Well-Known Member
PartnerNOC
Jun 4, 2008
220
6
68
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?
 

Archmactrix

Well-Known Member
Jan 20, 2012
138
2
68
cPanel Access Level
Root Administrator
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?
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
 

MikeDVB

Well-Known Member
PartnerNOC
Jun 4, 2008
220
6
68
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.
 

MikeDVB

Well-Known Member
PartnerNOC
Jun 4, 2008
220
6
68
Indiana, USA
Of course I'm not using the default mail account. I have already created an email account and it's working.
You're the one that brought up the cPanel username and password - not me :).

Sounds to me like your issue is resolved, no?
 

Archmactrix

Well-Known Member
Jan 20, 2012
138
2
68
cPanel Access Level
Root Administrator
You're the one that brought up the cPanel username and password - not me :).

Sounds to me like your issue is resolved, no?
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.
 

MikeDVB

Well-Known Member
PartnerNOC
Jun 4, 2008
220
6
68
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
 

Archmactrix

Well-Known Member
Jan 20, 2012
138
2
68
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.
 

MikeDVB

Well-Known Member
PartnerNOC
Jun 4, 2008
220
6
68
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].
 

Archmactrix

Well-Known Member
Jan 20, 2012
138
2
68
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