
How to set up Amazon SES SMTP in Laravel?
Laravel SMTP Setup Documentation (Using Amazon SES)
This documentation explains how to configure Amazon SES as your SMTP server in a Laravel application.
Step 1: Create and Verify Domain or Email in Amazon SES
- Go to Amazon SES Console
- In the SES dashboard, choose either:
- Email Addresses → Verify an email address (easiest for testing)
- OR Domains → Verify a domain (better for production)
- Once verified, your sender will be authorized to send emails.
For sandbox accounts, you can only send to verified addresses unless you request production access.
Step 2: Generate SMTP Credentials
- In SES Console, go to SMTP Settings → Click on Create My SMTP Credentials
- Choose a name like laravel-smtp-user
- After creating, download/save:
- SMTP Username
- SMTP Password (auto-generated, not your AWS secret key)
Step 3: Add SMTP Details to File in Laravel
Update your .env file with the following:
📌 Replace:
- your_smtp_username → The SMTP username from SES
- your_smtp_password → The generated SMTP password
- your_verified_email@example.com → The verified sender email
- Region Note: Update MAIL_HOST Based on your SES region:
👉 Full list of endpoints: SES Regions & Endpoints
Step 4: Clear Laravel Config Cache
After updating .env, run:
Step 5: Test Email Sending in Laravel
use Illuminate\Support\Facades\Mail;
Mail::raw('Test email from Amazon SES SMTP.', function ($message) { $message->to('receiver@example.com') ->subject('Amazon SES SMTP Test'); });