I have tried (i think) every suggestion on here to fix this. I have godaddy as a host on a linux installation. I was using gmail for site email, then switch to the godaddy email for a trial to fix problem. I have contacted the web host to make sure that ports were not blocked. To no avail i can not get drupal to connect to the smtp host. Im running D7.7. It makes it hard for users to register on the site when they cant get the conformation email. Any help would be appreciated.

CommentFileSizeAuthor
#19 smtp.zip731.94 KBwaqasali

Comments

Craig617’s picture

I'm having the exact same issue, and have tried everything I can think of or have read about.

Does anyone have any ideas how to solve this? Thanks!

daleykd’s picture

This is happening to me, also.

Drupal 7.8
Trying to use GMail (none of my email is hosted with my web host). It just refuses to connect to GMail.

Please, any help would be appreciated.

josesanmartin’s picture

Status: Active » Postponed (maintainer needs more info)

There could be a lot of reasons for that.

* Check your SMTP settings (configs for GMail: smtp.gmail.com, port 465, and you must "Use SSL")
* Check whether Apache is able to connect to the smtp server (there might be firewalls, network issues, etc)

If everything is alright, please check the "Enable debugging" checkbox in the SMTP settings page and post the results here.

zibby72’s picture

same problem here. "enable debugging" does not spit out any errors.

my setup:
Go-daddy Linux VPS D7.7

africahost’s picture

adroit_91’s picture

Issue tags: +gmail, +smtp

Subscribing.

carajito’s picture

SMTP -> ERROR: Failed to connect to server: Connection timed out (110)
SMTP Error: Could not connect to SMTP host.

Godaddy linux server, what can I do?

carajito’s picture

Error for godaddy server:

SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "220 p3nlsmtp09.shr.prod.phx3.secureserver.net ESMTP "
SMTP -> get_lines(): $data is "220 p3nlsmtp09.shr.prod.phx3.secureserver.net ESMTP "
SMTP -> FROM SERVER:220 p3nlsmtp09.shr.prod.phx3.secureserver.net ESMTP
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "250-p3nlsmtp09.shr.prod.phx3.secureserver.net "
SMTP -> get_lines(): $data is "250-p3nlsmtp09.shr.prod.phx3.secureserver.net "
SMTP -> get_lines(): $data was "250-p3nlsmtp09.shr.prod.phx3.secureserver.net "
SMTP -> get_lines(): $str is "250-PIPELINING "
SMTP -> get_lines(): $data is "250-p3nlsmtp09.shr.prod.phx3.secureserver.net 250-PIPELINING "
SMTP -> get_lines(): $data was "250-p3nlsmtp09.shr.prod.phx3.secureserver.net 250-PIPELINING "
SMTP -> get_lines(): $str is "250-SIZE 31457280 "
SMTP -> get_lines(): $data is "250-p3nlsmtp09.shr.prod.phx3.secureserver.net 250-PIPELINING 250-SIZE 31457280 "
SMTP -> get_lines(): $data was "250-p3nlsmtp09.shr.prod.phx3.secureserver.net 250-PIPELINING 250-SIZE 31457280 "
SMTP -> get_lines(): $str is "250 8BITMIME "
SMTP -> get_lines(): $data is "250-p3nlsmtp09.shr.prod.phx3.secureserver.net 250-PIPELINING 250-SIZE 31457280 250 8BITMIME "
SMTP -> FROM SERVER: 250-p3nlsmtp09.shr.prod.phx3.secureserver.net 250-PIPELINING 250-SIZE 31457280 250 8BITMIME
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "553 sorry, your mail was administratively denied. (#5.7.1) "
SMTP -> get_lines(): $data is "553 sorry, your mail was administratively denied. (#5.7.1) "
SMTP -> FROM SERVER:553 sorry, your mail was administratively denied. (#5.7.1)
SMTP -> ERROR: MAIL not accepted from server: 553 sorry, your mail was administratively denied. (#5.7.1)
The following From address failed: mail@mysite.com

artimedius’s picture

I've experienced the same problems; something like that in the beginnig, settings were working, an suddenly, errors, getting via debug what follows:
SMTP -> ERROR: Failed to connect to server: Connection refused (111)
SMTP Error: Could not connect to SMTP host.

I've noticed a strange behaviour, and I do not know if is something that could interest some suspicious...
it seems when I type the smtp username and smtp password in the SMTP AUTHENTICATION fieldset, and then I 'save configuration', the smtp username is stored and appears, but the field of smtp password turns to empty again (is that normal?)

(by the way) just because I need it for a commercial website for new users to login, (sounds like urgent, doesn't it? :-), I also ask if there is another valid module for using SMTP using scripts PHP/CGI, for Versione D7.8?

waiting for revolution... wishing the resolution... !

artimedius’s picture

my first solution is: Gmail

as we know, ther's always something that fits things more than anything else... so I tested the module using gmail account and smtp.gmail.com/465/... settings. things work perfect, so I assume that our shared/dedicated host should have gmail-like setups and behaviours, and we should complain to our 'not-well-configured-for-drupal' hosts, 'cause maybe they prefer do that for joomlers or wordpressers ('cause they are majority)...

So
1- donwload SMTP AUTHENTICATION SUPPORT module
2- download PHP mailer 5.1 (full library)
CREATING COMPLETE MODULE...
3- rename PHP mailer 5.1 folder to 'phpmailer' (small caps!)
4- move the folder 'phpmailer' into the 'smtp' folder (of the module smtp, of course)
ONCE YOU'VE DONE THIS, THE COMPLETED SMTP MODULE IS READY FOR YOUR SITE
5- upload it into the 'modules' folder of your drupal installation on server
6- install the module smtp that you've uploaded from your drupal modules administration page
7- configure then smtp module:
a) activate it turn it ON
b) use as SMTPserver: smtp.gmail.com
c) use as SMTPport: 465
d) use encryption: SSL
c) SMTPuser: your gmail username
d) SMTPpword: your gmail password
e) send a testing mail to assure everything works fine...
Every thing should work fine!

8- say a little prayer for all our 'drupal-awareness' :-)

bye drupal-folks

zabalex’s picture

I had the same issue with my host. They told me to try every possible option, stated that it was a problem with my code, email server, application (drupal), etc.
I wasted 2 weeks, than hired a guy to develop firewall ports blocking detection application, and here it is. As soon as I was able to proove to hosting company that they blocked port 465 and show them my little utility, everything went fine and they responded that it was firewall security issue and opened the port.
Here is the tool: Port forwarding tester external server:

Let me know what you think

wundo’s picture

Status: Postponed (maintainer needs more info) » Fixed

zabalex, i think that a simple telnet from your server to your smtp server should be enough to tell you either this is a network problem or not.

zabalex’s picture

If the site is hosted in the environment which does not offer telnet or ssh?
I am personally not that familiar with telnet, just never needed it. Now I'm a bit surprised why it took that long for admins at hosting company to detect the issue. You can't begin to emagine what wild guesses they were throwing at me regarding issues with my smtp problem. I can elaborate on request if someone lacks some joke sources.

Thanks Wundo for your feedback though

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

rkgdrupal’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta1
Status: Closed (fixed) » Needs work

I have a same issue with smtp module. I am getting following error 'SMTP Error: Could not connect to SMTP host.' when Testing a connection.Pls anyone help me.

feugana1’s picture

Hello I installed smtp Authentification Module and had done configuration by when i want to test sending, it appear this error :

SMTP.module is active.
The configuration options have been saved.
SMTP.module is active.
A test e-mail has been sent to xxx@gmail.com. You may want to check the logs for any error messages.

Error message
Unable to send e-mail. Contact the site administrator if the problem persists.

waqasali’s picture

its basically depends on the way you are using email service.
if you are working on web server then it is important to know that either web servers provide ssl support or not like 000webhost for free users doesn't support ssl.
if you are using on local server then
1- donwload SMTP AUTHENTICATION SUPPORT module
2- download PHP mailer 5.1 (full library)
CREATING COMPLETE MODULE...
3- rename PHP mailer 5.1 folder to 'phpmailer' (small caps!)
4- move the folder 'phpmailer' into the 'smtp' folder (of the module smtp, of course)
ONCE YOU'VE DONE THIS, THE COMPLETED SMTP MODULE IS READY FOR YOUR SITE
5- upload it into the 'modules' folder of your drupal installation on server
6- install the module smtp that you've uploaded from your drupal modules administration page
7- configure then smtp module:
a) activate it turn it ON
b) use as SMTPserver: smtp.gmail.com
c) use as SMTPport: 465
d) use encryption: SSL
c) SMTPuser: your gmail username
d) SMTPpword: your gmail password
e) send a testing mail to assure everything works fine...
Every thing should work fine!

thanks drupal-folks

waqasali’s picture

StatusFileSize
new731.94 KB

this is modified smtp module check it...

wundo’s picture

Priority: Major » Minor
Status: Needs work » Closed (works as designed)

This is not major, as it's probably a mistake in your configuration.

pmohDrupal7’s picture

Hi,

I set a local host apache server with Drulpal 7.

SMTP module is actived.
Enable debugging is checked. (http://localhost:8081/?q=node#overlay=%3Fq%3Dadmin%252Fconfig%252Fsystem...)
Set test mail with address: "moh.peter@yahoo.com" and click button.

No errro message. But no mail receveied as I check yahoo mail

Following is the SMTP ssettting
mysql> select * from variable where name like 'smtp%';
smtp_allowhtml i:1;
smtp_debugging i:1;
smtp_from s:14:"pmoh@mtahq.org";
smtp_fromname s:14:"pmoh@mtahq.org";
smtp_host s:14:"127.0.0.1:8081";
smtp_hostbackup s:9:"mtahq.org";
smtp_library s:34:"sites/all/modules/smtp/smtp.module";
smtp_on s:1:"1";
smtp_password s:0:"";
smtp_port s:2:"25";
smtp_protocol s:8:"standard";
smtp_username s:0:"";
12 rows in set (0.00 sec)

rashmit sidhu’s picture

Issue summary: View changes

This code is useful for sending mail from local host using Gmail.

Google account configuration

Read this Google Help.

1) Open your web browser and sign in to Gmail at http://mail.google.com/mail. If you see a word verification request, type the letters in the distorted picture and finish signing in.

2) Close your browser and try accessing your messages in your email client again.

3) If you're still having problems, visit and sign in with your Gmail username and password. If necessary, enter the letters in the distorted picture and click continue.

Restart your mail client and try accessing messages in your email client again.

System access configuration

Need to allow access for firewall or network to send mail for linux, windows and mac.

Following command set permission for linux.

1) iptables -I OUTPUT -p tcp --dport 465 -j ACCEPT
2) iptables -I OUTPUT -p tcp --dport 587 -j ACCEPT

SMTP Authentication Support

Set your gmail and google app information.

1) If you want to use Gmail as SMTP server,

SMTP server: smtp.gmail.com
SMTP port: 465
Use encrypted protocol: Use SSL 
SMTP Authentication
        Username : youremail@gmail.com or ouremail@yourGoogleAppsDomainName.com(google app)
        Password : yourpassword

Note : Remove leading and trailing space from "SMTP Authenitcation Username" if is there otherwise it's not authenticate your request to gmail.

Let me know if you face any query/concern regarding this.

geekinpink’s picture

pushkar’s picture

I am late to the party but I had the same issue.
I was on CentOS 6.3 and 7..
There is some weirdness where the HTTP server is unable to connect to an external server (something something SELinux)

Try this : http://stackoverflow.com/questions/13489037/could-not-connect-to-smtp-host

OS CentOS 6.3

Couldn’t send emails

after some reserch turned out that SELinux is blocking the communication

SELinux is activated and configured by default. As such SELinux does not allow Apache (httpd,phpmailer) to use the sendmail function and make any sort of network connection.

Using the getsebool command we can check if httpd demon is allowed to make a connection over the network and send an email.

getsebool httpd_can_sendmail
getsebool httpd_can_network_connect

This command will return a boolean on or off. If its off, we can set it on using the following:

sudo setsebool -P httpd_can_sendmail 1
sudo setsebool -P httpd_can_network_connect 1

Now you can test your php, code to see if SendMail work properly or not.

arefen’s picture

i can't send email but if set my email in thunderbird i can send email. bellow debug message. Can anyone help me?

SMTP -> FROM SERVER:
SMTP -> FROM SERVER:
SMTP -> ERROR: EHLO not accepted from server:
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "220-cpanel.jeciran.com ESMTP Exim 4.86 #2 Thu, 29 Oct 2015 12:55:06 +0330 "
SMTP -> get_lines(): $data is "220-cpanel.jeciran.com ESMTP Exim 4.86 #2 Thu, 29 Oct 2015 12:55:06 +0330 "
SMTP -> get_lines(): $data was "220-cpanel.jeciran.com ESMTP Exim 4.86 #2 Thu, 29 Oct 2015 12:55:06 +0330 "
SMTP -> get_lines(): $str is "220-We do not authorize the use of this system to transport unsolicited, "
SMTP -> get_lines(): $data is "220-cpanel.jeciran.com ESMTP Exim 4.86 #2 Thu, 29 Oct 2015 12:55:06 +0330 220-We do not authorize the use of this system to transport unsolicited, "
SMTP -> get_lines(): $data was "220-cpanel.jeciran.com ESMTP Exim 4.86 #2 Thu, 29 Oct 2015 12:55:06 +0330 220-We do not authorize the use of this system to transport unsolicited, "
SMTP -> get_lines(): $str is "220 and/or bulk e-mail. "
SMTP -> get_lines(): $data is "220-cpanel.jeciran.com ESMTP Exim 4.86 #2 Thu, 29 Oct 2015 12:55:06 +0330 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail. "
SMTP -> FROM SERVER: 220-cpanel.jeciran.com ESMTP Exim 4.86 #2 Thu, 29 Oct 2015 12:55:06 +0330 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
SMTP -> ERROR: HELO not accepted from server: 220-cpanel.jeciran.com ESMTP Exim 4.86 #2 Thu, 29 Oct 2015 12:55:06 +0330 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "250-cpanel.jeciran.com Hello bestnik.ir [130.185.74.157] "
SMTP -> get_lines(): $data is "250-cpanel.jeciran.com Hello bestnik.ir [130.185.74.157] "
SMTP -> get_lines(): $data was "250-cpanel.jeciran.com Hello bestnik.ir [130.185.74.157] "
SMTP -> get_lines(): $str is "250-SIZE 52428800 "
SMTP -> get_lines(): $data is "250-cpanel.jeciran.com Hello bestnik.ir [130.185.74.157] 250-SIZE 52428800 "
SMTP -> get_lines(): $data was "250-cpanel.jeciran.com Hello bestnik.ir [130.185.74.157] 250-SIZE 52428800 "
SMTP -> get_lines(): $str is "250-8BITMIME "
SMTP -> get_lines(): $data is "250-cpanel.jeciran.com Hello bestnik.ir [130.185.74.157] 250-SIZE 52428800 250-8BITMIME "
SMTP -> get_lines(): $data was "250-cpanel.jeciran.com Hello bestnik.ir [130.185.74.157] 250-SIZE 52428800 250-8BITMIME "
SMTP -> get_lines(): $str is "250-PIPELINING "
SMTP -> get_lines(): $data is "250-cpanel.jeciran.com Hello bestnik.ir [130.185.74.157] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING "
SMTP -> get_lines(): $data was "250-cpanel.jeciran.com Hello bestnik.ir [130.185.74.157] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING "
SMTP -> get_lines(): $str is "250-AUTH PLAIN LOGIN "
SMTP -> get_lines(): $data is "250-cpanel.jeciran.com Hello bestnik.ir [130.185.74.157] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN "
SMTP -> get_lines(): $data was "250-cpanel.jeciran.com Hello bestnik.ir [130.185.74.157] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN "
SMTP -> get_lines(): $str is "250-STARTTLS "
SMTP -> get_lines(): $data is "250-cpanel.jeciran.com Hello bestnik.ir [130.185.74.157] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN 250-STARTTLS "
SMTP -> get_lines(): $data was "250-cpanel.jeciran.com Hello bestnik.ir [130.185.74.157] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN 250-STARTTLS "
SMTP -> get_lines(): $str is "250 HELP "
SMTP -> get_lines(): $data is "250-cpanel.jeciran.com Hello bestnik.ir [130.185.74.157] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN 250-STARTTLS 250 HELP "
SMTP -> ERROR: AUTH not accepted from server: 250-cpanel.jeciran.com Hello bestnik.ir [130.185.74.157] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN 250-STARTTLS 250 HELP
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "250 cpanel.jeciran.com Hello bestnik.ir [130.185.74.157] "
SMTP -> get_lines(): $data is "250 cpanel.jeciran.com Hello bestnik.ir [130.185.74.157] "
SMTP -> FROM SERVER:250 cpanel.jeciran.com Hello bestnik.ir [130.185.74.157]
SMTP Error: Could not authenticate.
bwoods’s picture

Thank you pushkar - I ran into the same problem you had three years ago. This certainly saved me time having to look it up myself!