Connection could not be established with host smtp.googlemail.com

In Laravel project directory, edit config/mail.php and add the following:
'stream' => [
        'ssl' => [
            'allow_self_signed' => true,
            'verify_peer' => false,
            'verify_peer_name' => false,
        ],
    ]
    
It worked for me.

Fyi, my SMTP settings are:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=[Full Gmail Address]
MAIL_PASSWORD=[Google App Password obtained after two step verification on Google Account Page]
MAIL_ENCRYPTION=ssl

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to tcp://smtp.gmail.com:587 (Network is unreachable)\ Connection could not be established with host smtp.googlemail.com :stream_socket_client(): SSL: An existing connection was forcibly closed by the remote host. "Connection could not be established with host smtp.googlemail.com :stream_socket_client(): unable to connect to tcp://smtp.googlemail.com:587 (Connection timed out)", "exception": "Swift_TransportException", Connection could not be established with host smtp.googlemail.com :stream_socket_client(): Peer certificate CN Connection could not be established with host smtp.googlemail.com :stream_socket_client(): Peer Connection could not be established with host smtp.googlemail.com :stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: e Connection could not be established with host smtp.googlemail.com :stream_socket_client(): SSL: Connection could not be established with host smtp.mailtrap.io [Connection refused #111] Connection could not be established with host smtp.mailtrap.io :stream_socket_client(): SSL operation failed with code 1. Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to ssl://smtp.gmail.com:587 (Connection refused) Connection could not be established with host smtp.googlemail.com :stream_socket_client(): unable to connect to ssl://smtp.googlemail.com:465 (Network is unreachable Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Connection timed out) laravel Connection could not be established with host smtp.gmail.com :stream_socket_client( Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to tcp://smtp.gmail.com:587 Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to tcp://smtp.gmail.com:567 Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to tcp://smtp.gmail.com:587 (Connection refused) Connection could not be established with host smtp.mailtrap.io Swift_TransportException: Connection could not be established with host smtp.googlemail.com :stream_socket_client(): Connection could not be established with host smtp.mailgun.org :stream_socket_client(): unable to connect to smtp.mailgun.org:1025 (Connection timed out) Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to ssl://smtp.gmail.com:587 live.ERROR: Connection could not be established with host smtp.gmail.com :stream_socket_client(): u Connection could not be established with host smtp.googlemail.com :stream_socket_client(): unable to connect to tcp://smtp.googlemail.com:587 (Connection refused) Connection could not be established with host smtp.googlemail.com.io :stream_socket_client(): Connection could not be established with host smtp.googlemail.com laravel Connection could not be established with host smtp.mailgun.org swiftmailer codeigniter Swift_TransportException: Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to smtp.gmail.com:1025 (Se produjo un error durante e Connection could not be established with host smtp.google.it :stream_socket_client(): Connection could not be established with host smtp.gmail.com :st Connection could not be established with host email-smtp.us-east-2.amazonaws.com [ #0] connection could not be established with host smtp.gmail.com laravel godaddy Mailtrap Connection could not be established with host smtp.gmail.com :stream_socket_client(): Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to smtp.gmail.com:2525 Connection could not be established with host smtp.googlemail.com [Network is unreachable #101] Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to tcp://smtp.gmail.com:587 (Network is unreachable) Connection could not be established with host smtp.gmail.com sendgrid Connection could not be established with host smtp.mailtrap.io :stream_socket_client(): unable to connect to tcp://smtp.mailtrap.io:2525 (Connection refused)" Connection could not be established with host smtp.mailtrap.io :stream_socket_client(): unable to connect to tcp://smtp.mailtrap.io:2525 (Connection refused) Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to tcp://smtp.gmail.com:585 connection could not be established with host smtp.gmail.com Connection could not be established with host smtp.caretimes.us Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to tcp://smtp.gmail.com:587 (Network is unreachable) LARAVEL laravel Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to tsl://smtp.gmail.com:587 Connection could not be established with host smtp.googlemail.com :stream_socket_client(): unable to connect to ssl://smtp.googlemail.com:465 (Network is unreachable) Connection could not be established with host smtp-relay.sendinblue.com :stream_socket_client(): unable to connect to tcp://smtp-relay.sendinblue.com:587 (Connection refused) connection could not be established with host mail error Connection could not be established with host smtp.hostinger.co.id [ #0] message: "Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to tcp://smtp.gmail.com:587 (Connection refused)" Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Connection refused) Connection could not be established with host smtp.gmail.com :stream_socket_client(): Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Network is unreachable) connection could not be established with host smtp gmail com connection ti med out #110 Connection could not be established with host smtp.hostinger.com in laravel 5.8 Connection could not be established with host mailhog :stream_socket_client():
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source