jblasius
jblasius

Reputation: 13

class.phpmailer.php SMTP -> ERROR: Failed to connect to server

I've been using class.phpmailer.php for some time but recently it stop working on my web server.

It is still working on my home computer but I guess that it's because I didn't update xampp.

The error returned is:

php SMTP -> ERROR: Failed to connect to server: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060)

I've also used this class eukhost and it sends the email with no errors.

I'm now going debugging class.phpmailer.php to see what is wrong.

But before I start, I would like to know if someone got this problem ans solved it.

Upvotes: 0

Views: 5303

Answers (1)

drew010
drew010

Reputation: 69937

If this had been working and now has recently stopped, it could be a temporary issue, or some settings for the mail server have been changed and you now need to update your settings.

The error message is telling you that it could not connect to the mail server. Socket error 10060 is a general operation timed out message.

You need to verify that the SMTP host and port numbers being used by phpmailer are correct. You should from another machine (or the same system running PHP) be able to telnet your-mail-server-here.com 25 where 25 represents the port number.

If you can't connect to the server, then the mail server is down or the hostname or port have changed. If you can connect from other systems but not from your PHP server, it is possible your IP has been blocked from the mail server, or a local/remote firewall are preventing your connection.

Hope that helps.

Upvotes: 2

Related Questions