Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm having problems with the connection to gmail.
Situation:
1. opennssl is active because options appear in the settings page
2. SMTP server : smtp.gmail.com
3. SMTP port: 465 or 587 (both tried)
4. Use encrypted protocol: SSL and TLS (both tried)
5. SMTP username: my gmail account (@gmail.com included)
6. SMTP password: my gmail account password
7. Email adress to send email to: another email adress of mine
Results:
* warning: fsockopen(): unable to connect to smtp.gmail.com:587 in /home/vhosts/libraway.com/httpdocs/sites/all/modules/smtp/smtp.module on line 1894.
* warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in /home/vhosts/libraway.com/httpdocs/sites/all/modules/smtp/smtp.module on line 1894.
* warning: fsockopen(): unable to connect to :587 in /home/vhosts/libraway.com/httpdocs/sites/all/modules/smtp/smtp.module on line 1894.
Please, I need some help because my host doesn't allow me mail() and SMTP is the only way to go!
Comments
Comment #1
mishhh CreditAttribution: mishhh commentedAfter researching on web, I found a clue. It is possible that a bug in php versions lower than 4.3 could cause this error... My host has v4.1 so I qualify for this possible bug...
Two questions appear:
1. Is there a possibility to avoid fsockopen() for versions of php lower than 4.3? This question stands up only if there is a real bug with fsockopen()
2. Can there be problems with host's firewall? Can this warning appear if 25, 465 or 587 ports are closed?
Comment #2
smk-ka CreditAttribution: smk-ka commentedFrom the PHP manual:
This simply means, that below 4.3 there is no support for 'ssl://' or 'tls://'.
--
Stefan Kudwien
http://www.unleashedmind.com
Comment #3
eliza411 CreditAttribution: eliza411 commentedI, too, am having this problem connecting to gmail. I have a duplicate install using php 5.1 and a troublesome one using 4.2.2
warning: fsockopen() [function.fsockopen]: unable to connect to smtp.gmail.com:465 in /sites/default/modules/smtp/smtp.module on line 1894.
Comment #4
muchitsujo1 CreditAttribution: muchitsujo1 commentedDarn near a year and a few months later I'm having this problem also. It's not the PHP version, because the shared server I'm on is (still) using 4.3.11. If anyone has any ideas or heard of a patch being released for this, it would be awesome!
Comment #5
Zorod CreditAttribution: Zorod commentedI am having Google host my domain's email at Google Apps.
I have chosen all of the various settings (SMTP ports & TLS/SSL) found after searching the internet. But I always get the similar errors.
After 'Save Configuration'
warning: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Connection timed out) in /home2/living/public_html/modules/smtp/phpmailer/class.smtp.php on line 122.
warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home2/living/public_html/modules/smtp/phpmailer/class.smtp.php on line 122.
warning: fsockopen() [function.fsockopen]: unable to connect to ssl://:465 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /home2/living/public_html/modules/smtp/phpmailer/class.smtp.php on line 122.
Unable to send e-mail. Please contact the site admin, if the problem persists.
The last line of class.smtp.php is line 122
#connect to the smtp server
$this->smtp_conn = fsockopen($host, # the host of the server
$port, # the port to use
$errno, # error number if any
$errstr, # error message if any
$tval); # give up after ? secs
I'm not finding anything that works yet.
PS: bluehost is my host, although they do not host my email (google apps does this)
Comment #6
open-keywords CreditAttribution: open-keywords commentedHi
I suggest a simple test code, this would allow you to check your PHP capabilities and your hosting provider's firewall settings
Comment #7
mitchell CreditAttribution: mitchell commentedThank you open-keywords.
Comment #8
Zorod CreditAttribution: Zorod commentedOK, here are the results. I cannot interpret this to any meaningful results (lack of PHP knowledge). I uploaded the page temporarily to: ---------------
www.google.com - ok
Warning: fsockopen() [function.fsockopen]: unable to connect to smtp.gmail.com:465 (Connection timed out) in /home2/livingz0/public_html/test.php on line 17
smtp.gmail.com 465 - Connection timed out (110)
Warning: fsockopen() [function.fsockopen]: unable to connect to smtp.gmail.com:587 (Connection timed out) in /home2/livingz0/public_html/test.php on line 24
smtp.gmail.com 587 - Connection timed out (110)
Comment #9
open-keywords CreditAttribution: open-keywords commentedIt shows that your hosting provider is blocking the access to smtp.gmail.com on the required ports.
Your PHP version and settings looks fine.
You probably should contact their support.
Comment #10
Zorod CreditAttribution: Zorod commentedI've yet to get the info from my ISP, but I'm assuming they do this to help prevent spam and such?
Comment #11
Zorod CreditAttribution: Zorod commentedOK, I have my form working. I am using the Webform module http://drupal.org/project/webform. I was using the SMTP Authentication Support as well.
There were 2 things I needed to do.
"Always accept mail locally even if the primary mx does not point to this server." was NOT selected.
Comment #12
oadaeh CreditAttribution: oadaeh commentedReturning this issue to it's previous state.
Comment #13
filidis CreditAttribution: filidis commentedI had the same issue.
But the solution was very simple:
1. go to Modules>Mail: you'll see a NEW option "E-mail engine:".
2. Change it to "SMTP - SMTP mailing engine using SMTP module" and everything will work fine.
Comment #15
kumar7878 CreditAttribution: kumar7878 commentedhi
stmp modules i didn't find any "E-mail engine."
please can u help me.
Comment #16
kumar7878 CreditAttribution: kumar7878 commentedhi ,
Do you got solution for
Warning: fsockopen() [function.fsockopen]: unable to connect to smtp.gmail.com:465 (Connection timed out) in /home2/livingz0/public_html/test.php on line 17
smtp.gmail.com 465 - Connection timed out (110)
Warning: fsockopen() [function.fsockopen]: unable to connect to smtp.gmail.com:587 (Connection timed out) in /home2/livingz0/public_html/test.php on line 24
smtp.gmail.com 587 - Connection timed out (110)
for this error ..
if you got solution please help me.
Comment #17
sukh.singh CreditAttribution: sukh.singh commentedHi,
I am having same issue although my mail engine is SMTP and it was working fine over 1.5 years and it suddenly stopped working now. I am getting this error:
* warning: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Connection timed out) in /var/www/html/sites/all/modules/smtp/smtp.module on line 2069.
* warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/html/sites/all/modules/smtp/smtp.module on line 2069.
* warning: fsockopen() [function.fsockopen]: unable to connect to ssl://:465 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /var/www/html/sites/all/modules/smtp/smtp.module on line 2069.
Please let me know where is this problem cropping?
Comment #18
sanjith CreditAttribution: sanjith commentedhi,
have you fixed that problem, I am also getting this error.
* warning: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Connection timed out) in /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 public_html/sites/all/modules/smtp/phpmailer/class.smtp.php on line 122.
* warning: fsockopen() [function.fsockopen]: unable to connect to ssl://:465 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in public_html/sites/all/modules/smtp/phpmailer/class.smtp.php on line 122.
* Unable to send e-mail. Please contact the site administrator if the problem persists.
Comment #19
sanjith CreditAttribution: sanjith commentedhi,
I found the solution & fixed the above issue in my site.
In my drupal installation I set Port for TLS/STARTTLS: 587 now issue fixed
reference :http://mail.google.com/support/bin/answer.py?hl=en&answer=13287
thanks,
sanjith
www.titbit.in