Yii2 Symfony Mailer

Symfony Mailer integration for sending email from Yii Framework 2 apps.

Library
Composer
v4.0.0
49stars
BSD 3-Clause License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
48/100Fair
Development Activity60
Maintenance36
Community28
Maturity56
Momentum12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
79/100Good
Architecture82
Code Quality80
Innovation74
Learning Curve80

yii2-symfonymailer is the official Yii Framework 2.0 extension that provides email sending built on top of Symfony Mailer. It implements Yii’s mailer interface so applications compose and send messages through the familiar Yii::$app->mailer API while Symfony Mailer handles transport, delivery, and MIME construction under the hood.

Beyond basic delivery, the extension supports message signing and encryption, including DKIM signing and S/MIME signing and encryption, making it suitable for applications with stricter deliverability and security requirements.

What You Get

  • A drop-in Yii 2 mailer component backed by Symfony Mailer
  • Support for SMTP and other Symfony Mailer transports
  • DKIM message signing for improved deliverability
  • S/MIME message signing and encryption
  • View-based email composition using Yii templates
  • PSR event dispatching bridged into Symfony Mailer

Common Use Cases

  • Sending transactional email from a Yii 2 application via SMTP
  • Signing outgoing messages with DKIM for deliverability
  • Encrypting or signing sensitive email with S/MIME
  • Migrating a Yii 2 app off the deprecated SwiftMailer extension

Under The Hood

Architecture - The extension implements Yii’s mailer abstraction: src/Mailer.php extends Yii’s base mailer and delegates actual transport to a Symfony Mailer/Transport, while src/Message.php wraps a Symfony Email to satisfy Yii’s message interface. Cross-cutting concerns are modeled as small interfaces (MessageSignerInterface, MessageEncrypterInterface, MessageWrapperInterface) with concrete DkimMessageSigner, SMimeMessageSigner, and SMimeMessageEncrypter implementations. An EventDispatcherProxy and PsrEvent bridge Yii/PSR events into Symfony Mailer’s dispatcher. Tech Stack - PHP built on yiisoft/yii2 and the symfony/mailer component (plus related Symfony mime/transport packages). It targets modern PHP and the 4.x line requires up-to-date Yii 2 and Symfony versions. Code Quality - The repo ships CI build workflows, static analysis, and a PHPUnit test suite; it is a focused, small-surface extension maintained by the Yii core team. API Design - Configuration is declarative: set the app mailer component’s class to yii\symfonymailer\Mailer and configure the transport, after which composing and sending mail uses the same compose()/send() API developers already know from Yii.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search