If you prefer a tighter integration with template support and code generation, check out the Laravel SDK instead. The SDK integrates directly with Laravel’s mail transport while adding type-safe template features.
Prerequisites
Before you begin, make sure you have: You’ll also need:- Laravel 10.x, 11.x, or 12.x installed
- A
MAIL_FROM_ADDRESSthat uses your verified sending domain
Configuration
Verify config/mail.php
Ensure your No changes needed — the environment variables from
config/mail.php has the SMTP mailer configured. Laravel ships with this by default:.env will be automatically loaded.Sending Emails
Once configured, send emails using Laravel’s Mail facade exactly as you normally would:Using Mailables
Using Mail::raw()
For simple text emails without a Mailable class:Using Mail::html()
For HTML emails without a Mailable class:Testing Your Setup
Quick Test with Tinker
Send a test email using Tinker to verify your SMTP configuration:Test with a Real Mailable
Create a test Mailable:app/Mail/TestEmail.php:
resources/views/emails/test.blade.php:
Port Options
Lettr supports multiple SMTP ports. If port 587 doesn’t work for your environment, try these alternatives:| Port | Encryption | Configuration |
|---|---|---|
587 | STARTTLS (recommended) | MAIL_PORT=587 MAIL_ENCRYPTION=tls |
465 | Implicit TLS | MAIL_PORT=465 MAIL_ENCRYPTION=ssl |
2465 | Implicit TLS (alternate) | MAIL_PORT=2465 MAIL_ENCRYPTION=ssl |
2587 | STARTTLS (alternate) | MAIL_PORT=2587 MAIL_ENCRYPTION=tls |
Multiple Mailers
If you need to use both Lettr and another email provider (e.g., for different email types), configure multiple mailers:Error Handling
Wrap your mail sending in try-catch blocks to handle SMTP errors:Troubleshooting
Authentication failed
Authentication failed
Check your API key is correct and starts with
lttr_. Verify the username is exactly lettr (lowercase). Run php artisan config:clear to clear cached configuration.Connection timeout
Connection timeout
Your firewall may be blocking outbound SMTP connections. Try alternate ports (
465, 2465, or 2587). Verify smtp.lettr.com resolves correctly.Domain not verified
Domain not verified
Ensure your
MAIL_FROM_ADDRESS domain is verified in the Lettr dashboard. See Domain Verification for help.Emails not arriving
Emails not arriving
Check your Lettr logs to see if the API accepted the request. If accepted but not delivered, see Delivery Issues.
Enable debug logging
Enable debug logging
Enable Laravel’s mail debug logging in This logs all outgoing emails to
.env:storage/logs/laravel.log.For testing without sending real emails, use the log mailer: