Laravel Transactional Email
Send Laravel transactional email through SMTP relay or an email API with queues, retries, and delivery webhooks.
TL;DR
Laravel mailables should be queued, sent through authenticated SMTP or an email API adapter, and tracked with delivery webhooks. Use environment-driven mail settings so provider migration is a config change first.
What you will learn
- Configure Laravel mail for SMTP relay
- Use queues for transactional email
- Track final delivery state outside the initial send call
SMTP configuration
Use Laravel's SMTP mailer for the lowest-risk migration:
MAIL_MAILER=smtp
MAIL_HOST=smtp.postscale.io
MAIL_PORT=587
MAIL_USERNAME=your-smtp-username
MAIL_PASSWORD=your-smtp-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=alerts@example.com
MAIL_FROM_NAME="Acme"
The From domain still needs SPF, DKIM, and DMARC-compatible records in DNS.
Queue mailables
Laravel mailables can be queued so user requests do not wait on network delivery.
Mail::to($user->email)->queue(new WelcomeMail($user));
Make sure your queue retry policy does not create duplicate one-time links or regenerated receipts. Generate the token or invoice once, then retry sending the same message state.
REST API adapter
For new code, create a service class that posts to the email API. Keep it behind an interface so tests can use a fake sender.
final class TransactionalEmail
{
public function sendWelcome(User $user): void
{
// Build a normalized message and send it through your provider adapter.
}
}
This structure makes it easier to move from SMTP to REST later.
Webhook state
Laravel should not treat Mail::queue() as delivered. Store message state and update it from delivery webhooks:
- accepted
- delivered
- deferred
- bounced
- complained
Use a unique event ID so provider retries do not duplicate side effects.
References
Frequently asked questions
- Should Laravel mailables be queued?
- Yes for production transactional email. Queueing avoids slow requests and gives you controlled retry behavior.
- Can Laravel use Postscale SMTP?
- Yes. Configure the SMTP mailer with smtp.postscale.io, port 587, STARTTLS, and SMTP credentials.
Related guides
Put the guide into production
Postscale brings sending, inbound processing, DMARC reporting, and masked addresses behind one API so the operational pieces stay connected.