fsockopen error 158556472 when using Gmail. No port blocking

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
shakin
Forum Newbie
Posts: 2
Joined: Tue Mar 18, 2008 10:47 am

fsockopen error 158556472 when using Gmail. No port blocking

Post by shakin »

This appears to be a different issue from some of the many other fsockopen errors that are TLS or port blocking problems.

For about six months I have been able to send email through gmail's SMTP server without issues, but now it's not working. This is from a co-located server and there is no port blocking or firewall that might be interfering. The server is CentOS 4 and it might be possible that a software update caused the problem, but I can't see any updates that look suspicious.

Googling the error number doesn't help and there is no error message.

Error:
Fatal error: Uncaught exception 'Swift_Connection_Exception' with message 'The SMTP connection failed to start [tls://smtp.gmail.com:465]: fsockopen returned Error Number 158556472 and Error String ''' in /var/www/libs/swiftmailer/Swift/Connection/SMTP.php:277 Stack trace: #0 /var/www/libs/swiftmailer/Swift.php(218): Swift_Connection_SMTP->start() #1 /var/www/libs/swiftmailer/Swift.php(95): Swift->connect() #2 /var/www/htdocs/src/email.php(200): Swift->__construct(Object(Swift_Connection_SMTP)) #3 {main} thrown in /var/www/libs/swiftmailer/Swift/Connection/SMTP.php on line 277
Because this is my own server I can change anything that needs changing to get the problem fixed.

Thanks.
shakin
Forum Newbie
Posts: 2
Joined: Tue Mar 18, 2008 10:47 am

Re: fsockopen error 158556472 when using Gmail. No port blocking

Post by shakin »

I solved the problem. The DNS server I was using stopped responding so the server couldn't resolve smtp.gmail.com.

The error message is cryptic, so hopefully having this here will help someone else searching for a solution to this problem.
Post Reply