Title: Error notice: stream_socket_client()
Last modified: June 22, 2017

---

# Error notice: stream_socket_client()

 *  [blakebma](https://wordpress.org/support/users/blakebma/)
 * (@blakebma)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/error-notice-stream_socket_client/)
 * Hello,
 * I’ve been attempting to get this plugin working for a few days now. Everything
   on the Google side of things has been set up. I have an SSL certificate installed
   on my site & it’s fully secured. I’ve checked with my host & the ports SSL:465&
   TLS:587 are open. MX Records are properly setup, pointing to the Gmail SMTP server
   as verified by them & my host. I’ve talked with Google & they gave me options
   to try, none of which worked, as did my host with the same results. My site can’t
   go live until email is properly working. I’ve tried this on WP:4.7.2 & 4.8.
 *     ```
       Connection: opening to ssl://smtp.gmail.com:465, timeout=300, options=array ()
       Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Network is unreachable)
       SMTP ERROR: Failed to connect to server: Network is unreachable (101)
       SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
       ```
   
 * Thank you for any help you can provide.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [blakebma](https://wordpress.org/support/users/blakebma/)
 * (@blakebma)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/error-notice-stream_socket_client/#post-9253693)
 * Since I know you’ll ask:
 *     ```
       OS: Linux server.armorcomputer.net 3.10.0-427.18.2.lve1.4.24.el7.x86_64 #1 SMP Tue Oct 25 17:18:26 EDT 2016 x86_64
       PHP version: 5.6.28
       WordPress version: 4.8
       WordPress multisite: No
       openssl: Available
       allow_url_fopen: Enabled
       stream_socket_client: Available
       fsockopen: Available
       cURL: Available
       cURL Version: 7.38.0, OpenSSL/1.0.1e
       ```
   
 *  Plugin Author [Noor Alam](https://wordpress.org/support/users/naa986/)
 * (@naa986)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/error-notice-stream_socket_client/#post-9268452)
 * Hi, Gmail recommends TLS connection on port 587 (SSL is old). The info looks 
   good. But the debug data clearly states that the it’s not even being able to 
   connect to the remote SMTP server. Are you sure the ports are actually open (
   Web hosts like GoDaddy always say it’s open when they are not)? Who is your hosting
   provider?
 *  Thread Starter [blakebma](https://wordpress.org/support/users/blakebma/)
 * (@blakebma)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/error-notice-stream_socket_client/#post-9269631)
 * Hello, thank you for responding!
 * I receive the same result with SSL & TLS (port 587). I’ve been using Webspace
   Publishing as they’re a good friend. I’ve asked & have been told the ports are
   open, also checked with a few online tools. It’s quite confusing because each
   party says it should be working fine. I’ve ended up skipping Gmail integration
   for now. I’ll talk to my host again to see if they have any more input on the
   ports.
 * Thank you.
 *  [sunclouddesign](https://wordpress.org/support/users/sunclouddesign/)
 * (@sunclouddesign)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/error-notice-stream_socket_client/#post-9327816)
 * I am getting an almost identical error message:
 * Connection: opening to smtp.gmail.com:587, timeout=300, options=array ( ‘ssl’
   => array ( ‘verify_peer’ => false, ‘verify_peer_name’ => false, ‘allow_self_signed’
   => true, ),)
    Connection: Failed to connect to server. Error number 2. “Error
   notice: stream_socket_client(): unable to connect to smtp.gmail.com:587 (Network
   is unreachable) SMTP ERROR: Failed to connect to server: Network is unreachable(
   101) SMTP connect() failed. [https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting)
 * I have used [http://www.yougetsignal.com/tools/open-ports/](http://www.yougetsignal.com/tools/open-ports/)
   to verify ports 587 and 465 are open. I’ve tried both and both produce the same
   error message.
 * Server Info:
    OS: Linux host422.hostmonster.com 3.10.0-427.36.1.lve1.4.45.el6h.
   x86_64 #1 SMP Tue Apr 4 18:04:46 EDT 2017 x86_64 PHP version: 5.6.29 WordPress
   version: 4.8 WordPress multisite: No openssl: Available allow_url_fopen: Enabled
   stream_socket_client: Available fsockopen: Available cURL: Available cURL Version:
   7.24.0, OpenSSL/1.0.0
 *  [alongjohn](https://wordpress.org/support/users/alongjohn/)
 * (@alongjohn)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/error-notice-stream_socket_client/#post-9686223)
 * DId you ever get this resolved? I’m running into the same issue.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Error notice: stream_socket_client()’ is closed to new replies.

 * ![](https://ps.w.org/gmail-smtp/assets/icon-128x128.png?rev=2432932)
 * [Gmail SMTP](https://wordpress.org/plugins/gmail-smtp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gmail-smtp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gmail-smtp/)
 * [Active Topics](https://wordpress.org/support/plugin/gmail-smtp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gmail-smtp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gmail-smtp/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [alongjohn](https://wordpress.org/support/users/alongjohn/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/error-notice-stream_socket_client/#post-9686223)
 * Status: not resolved