symfony/mailer
Symfony Mailer helps you send emails via SMTP and other transports with a clean API. Build Email/TemplatedEmail messages, add attachments and headers, and integrate with Twig templates for HTML rendering. Configure transports via DSN and send reliably.
MAIL_* environment variables.MessageListener) are unchanged, maintaining compatibility with Laravel’s logging/retries.TemplatedEmail support remains unchanged, complementing Laravel’s Blade/Twig templates. No breaking changes to template rendering.Email/TemplatedEmail classes still mirror Laravel’s Mailable structure (e.g., from(), to(), subject()).SymfonyMailerTransport wrapper approach remains valid; no API changes affect this.config/mail.php is unchanged.Mailable classes can still use the SymfonyMailable trait without modification.SwiftMailer compatibility)?Mail facade or Mailable class structure.SymfonyMailerTransport adapter approach is still valid.SymfonyMailable trait can be reused without modification.NotificationChannel remains unchanged.RoundRobinTransport support is intact.| Phase | Action | Tools/Dependencies |
|---|---|---|
| 1. Evaluation | Verify beta stability: Test v8.1.0-BETA3 against our primary transports (SMTP/SendGrid). | symfony/mailer, Laravel Mail facade |
| 2. Security Audit | Confirm CVE-2026-45068 does not affect our transports (e.g., if using SMTP/SendGrid, no impact). | Custom test cases for malformed addresses |
| 3. Pilot | Replace one transport (e.g., SendGrid) in a non-critical module. | SymfonyMailerTransport adapter |
| 4. Core Adoption | Update config/mail.php to use Symfony Mailer DSN (unchanged). |
Laravel Service Provider |
| 5. Full Replace | Deprecate SwiftMailer; migrate Mailable classes to TemplatedEmail. |
PHPStan rules, Deprecation notices |
SymfonyMailerTransport (unchanged from v8.0.x):
Mail::extend('symfony', function ($app) {
$transport = Transport::fromDsn(env('MAIL_MAILER_DSN'));
return new Mailer($transport);
});
public function testMalformedSendmailAddress()
{
$this->expectException(InvalidArgumentException::class);
Transport::fromDsn('sendmail:/// -invalid');
}
TemplatedEmail decorator (no changes):
class SymfonyMailable extends Mailable
{
public function build()
{
return (new TemplatedEmail())
->htmlTemplate('emails.welcome')
->context($this->data);
}
}
RoundRobinTransport).ShouldQueue; no new features.Symfony\Component\Mailer\Exception\TransportExceptionHow can I help you explore Laravel packages today?