phpmailer gmail

Web hosting, FTP/database access, mirror services and hosted blogs
Post Reply
Posts: 4
Joined: Fri Nov 03, 2006 9:41 am

phpmailer gmail

Post by sliver » Sun Nov 02, 2008 6:24 pm


I am trying to set up a php script on my webspace which uses phpMailer to send emails through the GMail SMTP server using my GMail account.

The code is trying to connect to:

using SSL on port 465.

Unfortunately, I always get the following error from phpMailer:

ERROR: Failed to connect to server: Connection timed out (110)

So I am suspecting that the firewall on the hosting box is blocking my connection.

I have checked, and OpenSSL is installed & enabled on the hosting box.

Am I allowed to run such a script or it is not possible to have it working? If it should work, can anyone help on why it's not connecting?

The reason I am doing this is that GMail is blocked at work, and sometimes I need to send urgent emails using the GMail account.


Posts: 910
Joined: Wed Apr 23, 2008 6:45 pm

Re: phpmailer gmail

Post by vk3xem » Mon Nov 03, 2008 1:57 am

From the Gmail configuration: (use authentication)
Use Authentication: Yes
Use STARTTLS: Yes (some clients call this SSL)
Port: 465 or 587

Are you using authentication and have you tried port 587?
The views I present are that of my own and NOT of any organisation I may belong to.

73 de Simon, VK3XEM


Re: phpmailer gmail

Post by danielc » Mon Nov 03, 2008 9:06 am


Give it a try now; the connection should work. (I have tested it succesfully).

Daniel C

Posts: 4
Joined: Fri Nov 03, 2006 9:41 am

Re: phpmailer gmail

Post by sliver » Mon Nov 03, 2008 10:57 am

It works now!

Thanks very much for your prompt response and help!

Post Reply