Email providers
Local / Testing
Mailtrap
I personally use Mailtrap for emails in local environment, so it’s my recommendation. This doesn’t mean other services mentioned below are worse or better in any way. https://laravel.com/docs/11.x/mail#mailtrap- Create and setup Mailtrap account
- Update
.envfile with Mailtrap credentials
HELO
Coming soon…Mailpit
Coming soon…Production / Staging
doesn’t come with any pre-installed email service since there is not one that fits all cases, and it’s actually very easy to setup any of the services mentioned below. To implement desired mail service, just follow the instructions below or official Laravel docs.Mailgun
Coming soon…Postmark
Coming soon…Resend
Coming soon…MailerSend
- Install the package:
- Create a MailerSend account.
- Go to Integrations and create API token for your domain. Update your
.envfile:
- Add MailerSend to
config/mail.phpconfiguration file insidemailersarray:
Custom
https://laravel.com/docs/11.x/mail#custom-transports Coming soon…Queue emails
All emails are sent using Laravel’s deferred functions. If you need to send large amount of emails it’s recommended to send them in queues.Setup local queue
https://laravel.com/docs/11.x/mail#queueing-mail Docs coming soon…Setup queue worker
Docs coming soon…Laravel Horizon
Docs coming soon…Previews emails
You can preview emails in local environment. Preview routes are defined inroutes/emails.php route file.
Here is the list of all email preview routes (each route is prefixed with /email-previews):
/email-verificationEmail sent upon user registration (when email verification is enabled)/password-resetEmail sent upon password reset request/subscribedEmail sent upon successful subscription
Email templates
Default emails are rendered using markdown files located inresources/views/mail folder.
Main message layout: resources/views/vendor/mail/html/message.blade.php
resources/views/vendor/mail/html folder:
- layout: Main HTML file to render email template. You should probably leave this as-is.
- header: Application name with link to website, positioned above the content. You can update it to show your logo or anything relevant.
- footer: Copyright text below the content.
- panel: Highlighted text block.
- table: Table block.
- button: Action button. Accepts three parameters: color: primary (default), blue, green/success, red/error; url and align: left, right, center (default). You can add custom colors to default.css
button-{color_name}
- subcopy: Smaller text used as disclaimer.
- salutation: Included in message component.
resources/views/vendor/mail/html/themes/default.css CSS file.
