I have tried all of the suggestions found in the issue queue for this module, and yet I am unable to get it to connect to the Google Apps SMTP Server.

Here are my settings:
SMTP Server: smtp.gmail.com
Port: 587 or 465 (tried both)
Encryption: SSL and TLS (tried both with both ports)

Username:
myname@mydomain.com
Password: mypassword

Email from address: myname@mydomain.com
Email From Name: myreadablename

Send Test email to:
anotheraccount@mydomain.com

With these settings I receive the following error:
Error sending e-mail from myname@mydomain.com to anotheraccount@mydomain.com : SMTP Error: Could not connect to SMTP host.

Any help would be truly appreciated.

Comments

kd8fre’s picture

I should add that I am now finding that I am getting a (110) timeout error when it tries to connect.

Maung Maung’s picture

The problem is at myname@mydomain.com.

If you want to use Gmail as SMTP server, change myname@mydomain.com to youremail@gmail.com and password must be youremail@gmail.com password.

If you are using Gmail with Google Apps under your domain,
you can use youremail@yourGoogleAppsDomainName.com and password.

Hopefully this will help your problem.

kd8fre’s picture

I should have been more specific, I am using Google Apps for my domain. I am using my "youremail@yourGoogleAppsDomainName.com" and still having this issue. I use a custom script on another, non-drupal site to send from the same email address and it works fine.

Maung Maung’s picture

Hi, you can check the error log by checking the Enable Debugging check box above the Save Configuration button. So that you can get the cause of error in some way.

kd8fre’s picture

I have done that, here are the results from the log:
Error sending e-mail from myname@mydomain.com to anotheraccount@mydomain.com : SMTP Error: Could not connect to SMTP host.

This is the result from the on-screen print out from debugging:
SMTP -> ERROR: Failed to connect to server: Connection timed out (110)
SMTP Error: Could not connect to SMTP host.

kd8fre’s picture

I now know that the issue is the firewall on my server.
What do I need to do to change the firewall to make this work? I am on a CentOS shared server with root command line access.

kd8fre’s picture

Status: Active » Closed (works as designed)

Closing this, it is a firewall issue resolved by running the following commands:

iptables -I OUTPUT -p tcp --dport 465 -j ACCEPT
iptables -I OUTPUT -p tcp --dport 587 -j ACCEPT

bottle’s picture

I have the same issue, my host says he doesn't see any problem with firewall. what else can I do?

Where do I have to put the above mentioned commands?
iptables -I OUTPUT -p tcp --dport 465 -j ACCEPT
iptables -I OUTPUT -p tcp --dport 587 -j ACCEPT

thanks

poonam11210’s picture

Issue summary: View changes

I am facing the same issue and while debugging i get error as
"SMTP -> ERROR: Failed to connect to server: Permission denied (13)
SMTP Error: Could not connect to SMTP host."
What do i do? Is this firewall issue from hosting site or what? I am also using CentOS server.