Integration guide · Laravel

Laravel SMTP: six lines in your .env

Notifications, password resets and mailables: Laravel sends through SMTP Senpai by changing only the .env file.

  • 14-day free trial
  • Servers and data in the EU
  • A log of every delivery
4.7/5 · 83 reviewsGoogleCapterraTrustpilot
.env
MAIL_MAILER=smtp
MAIL_HOST=relay.mailsenpai.com
MAIL_PORT=2525
MAIL_USERNAME=your-username
MAIL_PASSWORD=your-password
[email protected]
MAIL_FROM_NAME="${APP_NAME}"
# up to Laravel 10: MAIL_ENCRYPTION=tls
the 4 details

Four details, and your emails go out

They are the same for every program: you also find them, already filled in, in your customer area.

Serverrelay.mailsenpai.com
Port2525
SecuritySTARTTLS
Username and passwordin the customer area, SMTP Senpai page

The sender must be on a domain verified in your area: otherwise the server refuses to send. For SPF, DKIM and DMARC records, use the free email DNS checker.

how to

Three steps

1

Copy the details

You find username and password in the customer area, SMTP Senpai page.

2

Update .env

Paste the lines and, if you cache your config, run php artisan config:clear.

3

Test it

With php artisan tinker: Mail::raw('Test', fn ($m) => $m->to('[email protected]')->subject('Test'));

Frequently asked questions

Do I need MAIL_ENCRYPTION?

Not from Laravel 11: on port 2525 STARTTLS starts automatically. Up to Laravel 10, set MAIL_ENCRYPTION=tls.

Do queued mails work?

Yes: queued mailables use the same SMTP mailer when the worker sends them.

Can I send without SMTP?

Yes, with the SMTP Senpai API and the key from the customer area; for Laravel, SMTP is the simplest route.

Try SMTP Senpai with your own software

A 14-day trial: connect your software, send your real emails and check the log line by line. Then decide.

14 days freeFree trial