How to send An Email From Gmail SMTP in Laravel

Post:
Sanzida Khan
Category:

if you have decide to use gmail smtp in your Laravel website , here we have describe. how you can archive it easy by follow below steps.

STEP : 01

login to your gmail account and go to “account > Security”

google account

STEP: 02

Click on app passwords

STEP: 03

google will ask you to confirm by your password. then you will see below screen select app “Mail”

STEP: 04

now select device, select custom name, and give it a name then click on Generate

STEP: 05

now copy marked password, use it instead of your gmail password in step 06

STEP 06

now open your .env file and setup below settings

if you are using google workspace then use

smtp-relay.gmail.com as your smtp host

MAIL_DRIVER=smtp
MAIL_HOST=smtp.googlemail.com
MAIL_PORT=465
MAIL_USERNAME=GMAIL_USERNAME
MAIL_PASSWORD=GMAIL_PASSWORD
MAIL_ENCRYPTION=ssl

If you are our cms user, then login to your admin panel go to “General Settings>SMTP Settings” and setup above info from here

that’s all now you can send mail from your Laravel app using Gmail SMTP

Let’s build to together