The free Gmail SMTP server
Feb 15, 2021
In this tutorial, I'm going to show you how to configure the Gmail SMTP server with Laravel. Usually, when you want to send emails you have to pay for some service. But using the Gmail server you can do it for free!
Configuring Laravel
In your Laravel .env
file, add these values:
MAIL_MAILER=smtp
MAIL_HOST=smtp.googlemail.com
MAIL_PORT=465
MAIL_USERNAME=john@gmail.com
MAIL_PASSWORD=password
MAIL_ENCRYPTION=ssl
MAIL_FROM_ADDRESS=john@example.org
MAIL_FROM_NAME="${APP_NAME}"
Be sure to add your full Gmail email address in the MAIL_USERNAME
section, like john@gmail.com. Next, add your password in the MAIL_PASSWORD
section.
When you start sending emails you'll probably get an email from Google where you have to confirm you want to use it.
That's it! Now you can send unlimited free emails using the Gmail SMTP server.
Note: using the Gmail SMTP server, you are limited to 100 emails per day.