loading

Laravel env Mail configuration

Laravel env Mail configuration
Laravel env Mail configuration
Laravel env Mail configuration

Hello everyone,

Today we learn how to setup laravel mail configuration in .env file.

To set up our mail we need to open .env file under root folder and edit these lines:

MAIL_DRIVER=
MAIL_HOST=
MAIL_PORT=
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=
PHP

 

look at the example below:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=   YOUR EMAIL ADDRESS (INCLUDED @GMAIL.COM)
MAIL_PASSWORD=  YOUR EMAIL PASSWORD
MAIL_ENCRYPTION=ssl
Markup

 

You also have 2 optional setting you can add to your .env file if you like to:

MAIL_FROM_ADDRESS=[email protected]
MAIL_FROM_NAME="CV. Irando website"
PHP

these options will set to your sent emails if you do not have default value for them in your codes.

Note: If your title is included space character you have to put your title inside  " " .

Telegram Cannel

Be the first to leave a comment.

You must login to leave a comment

back to top