Laravel - Connection could not be established with host smtp gmail com 0

0 votes

I have been working on sending an email from Gmail using Laravel from localhost. I'm getting this error:

Connection could not be established with host smtp.gmail.com [ #0]

I have been using ssl with port 465 and have additionally tried 587 but it didn't work. Additionally, I also tried many ways but it didn't work.

Feb 22, 2022 in Others by Rahul
• 9,680 points
14,752 views

1 answer to this question.

0 votes

While using the Laravel project directory, edit config/mail.php and add the following:

'stream' => [ 
              'ssl' => [ 
                        'allow_self_signed' => true, 
                        'verify_peer' => false, 
                        'verify_peer_name' => false, 
      ], 
]

Have shared my SMTP settings below:

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

Hope this answers your question. 

answered Feb 22, 2022 by Aditya
• 7,680 points

Related Questions In Others

0 votes
0 answers

No connection could be made because the target machine actively refused it?

 I was doing HttpWebRequest to a WebService ...READ MORE

May 5, 2022 in Others by Kichu
• 19,040 points
2,805 views
0 votes
0 answers

Creating an Instagram bot with reading an excel file and posing on Instagram, but some of words can not be read properly

from instabot import Bot import openpyxl import smtplib bot = ...READ MORE

Sep 26, 2022 in Others by Kithuzzz
• 38,000 points
804 views
0 votes
1 answer

In order to learn Node.js, I should be familiar with which other technologies ?

I appreciate your decision, its the perfect ...READ MORE

answered Jul 31, 2019 in Others by ArchanaNagur
• 2,360 points
870 views
0 votes
3 answers

How to download attachment from gmail using UiPath?

Download IMAP Attachment Extractor and smoothly extract ...READ MORE

answered Jun 29, 2020 in RPA by zoey
• 140 points
8,554 views
0 votes
1 answer

Receiving Emails from Gmail in UiPath

Hi, Integration of Gmail with UiPath can be ...READ MORE

answered Mar 16, 2019 in RPA by Mugdha
• 600 points
3,735 views
0 votes
1 answer

Could not open input file: artisan

This error happens because you didn't install ...READ MORE

answered May 1, 2022 in Other DevOps Questions by narikkadan
• 63,600 points
9,546 views
0 votes
0 answers

Javamail Could not convert socket to TLS GMail

I want to send an email using ...READ MORE

May 2, 2022 in Java by Kichu
• 19,040 points
2,961 views
0 votes
1 answer
0 votes
1 answer

Windows git "warning: LF will be replaced by CRLF", is that warning tail backward?

 Depending on the editor you are using, ...READ MORE

answered Feb 16, 2022 in Others by Aditya
• 7,680 points
5,793 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP