Executive Summary: How to properly configure Laravel Mailables with Amazon SES for high-throughput dispatch.
Laravel's Mail component is powerful, but out of the box, it's not optimized for sending millions of emails. When building platforms like Solidrix Send, you need to bypass standard mail drivers.
### Utilizing the SES API Directly
Instead of standard SMTP (which has higher latency due to connection handshakes), use the AWS SES HTTP API driver.
Configure your `.env`:
```env
MAIL_MAILER=ses
AWS_ACCESS_KEY_ID=your_key
AWS_SECRET_ACCESS_KEY=your_secret
AWS_DEFAULT_REGION=us-east-1
```
### Chunking & Queues
When dealing with bulk lists, always use Eloquent chunking to prevent memory exhaustion:
```php
Subscriber::where('active', true)->chunk(1000, function ($subscribers) {
foreach ($subscribers as $sub) {
Mail::to($sub)->queue(new MarketingCampaign($sub));
}
});
```
Run multiple queue workers using Supervisor to dispatch emails concurrently.