Sending mail worked through a Drupal site of mine, until just recently. I just noticed it tonight, and have been working on it for the last few hours. After searching the forums, the error that I'm getting seems common, but I don't know if I'm having the same error or not, as I've been trying to implement some of the solutions I've read, with no luck.

Here is the error displayed:

# warning: fsockopen() [function.fsockopen]: unable to connect to mail.hctc.com:25 (Connection timed out) in /home/shsband/www/modules/smtp/smtp.module on line 2069.
# warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/shsband/www/modules/smtp/smtp.module on line 2069.
# warning: fsockopen() [function.fsockopen]: unable to connect to :25 (Unknown error) in /home/shsband/www/modules/smtp/smtp.module on line 2069.
# warning: Cannot modify header information - headers already sent by (output started at /home/shsband/www/modules/smtp/smtp.module:2077) in /home/shsband/www/includes/common.inc on line 311.

Also, when I set the module to debug, it displayed this:

SMTP -> ERROR: Failed to connect to server: Connection timed out (110) SMTP -> ERROR: Failed to connect to server: (163011860) 

I don't know what to do next. I've tried to make sure that the "from" email address matches the domain of the SMTP server, and I've tried different SMTP servers as well, that I know are functioning correctly. The error occurs from the contact module, reset password page, and SMTP test email function.

Also, I remember installing the SMTP module because I couldn't get mail to send without it. If I cannot get the SMTP module to restore function again, how can I try getting mail to send without it?

Thanks so much in advance,
JS

Comments

jsartori’s picture

oadaeh’s picture

Is this still a problem for you? It looks like the remote SMTP server is either down or otherwise not responding to outside queries.

jsartori’s picture

I haven't been able to resolve this issue yet. I don't even know where to start. The SMTP server is functioning properly, and I have tried using several others that I know are working, just in case, but the same errors are returned.

drac.sa.evas’s picture

I'm experiencing a very close problem. I have already tried to use many SMTP servers (gmail, yahoo, hotmail, my own) and I get always the same error message:

warning: fsockopen() [function.fsockopen]: unable to connect to 189.82.168.251:25 (Connection timed out) in /home/portalge/public_html/sites/all/modules/smtp/phpmailer/class.smtp.php on line 122.
warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/portalge/public_html/sites/all/modules/smtp/phpmailer/class.smtp.php on line 122.
warning: fsockopen() [function.fsockopen]: unable to connect to :25 (Unknown error) in /home/portalge/public_html/sites/all/modules/smtp/phpmailer/class.smtp.php on line 122.
Não foi possível enviar o email. Por favor entre em contato com o administrador do site se o problema persistir.

With the debug option turned on I get also:
SMTP -> ERROR: Failed to connect to server: Connection timed out (110) SMTP -> ERROR: Failed to connect to server: (-1209265540)

I can't figure out what to do. I serched everywhere on the web and nobody seems to have solved it. Any light???????

Ps. I'm using Drupal 6.10 with the lastes SMTP module (I've also tried with Drupal 6.9, and the same happend).

Thanks!

mmilo’s picture

Was there an update on this issue?

A site for a previous client has run into the same issue (site is on 6.10), and has only started happening the past few days.

I can confirm it's not the SMTP server - a fresh install of 6.13 and only having this module installed will send the test e-mail to the SMTP server properly.

oadaeh’s picture

Maybe a firewall, router, dns or something similar is causing your connection problems. Those errors are not being generated by this module, but by the PHPMailer code and/or your sending system itself.

upperwestside’s picture

Hello!

I am getting almost exactly error as the one you had:

Warning: fsockopen() [function.fsockopen]: unable to connect to mail.(mydomain).org:25 (Connection timed out) in /home/(mydomain)/public_html/admin/includes/phpMailer_v2.3/class.smtp.php on line 122

Has there been any progress since you posted the issue?
If yes, what is it?
If no, would you pls share with me how you solved the issue?

thanks in advance!

Sborsody’s picture

Check that your webserver is able to resolve DNS queries. I'm guessing that the majority of people getting this fsockopen error are due to DNS resolution issues. For example, my webserver runs in a chroot jail and is not able to do DNS queries unless I've given it access inside its jail to a properly configured DNS resolver. I was getting this error then had to add the remote SMTP server name and IP address to a hosts file inside the jail and it then worked.

wundo’s picture

Status: Active » Closed (works as designed)