SwiftMailer e-mail library
Many web applications need to send notifications and confirm client actions by e-mail for security reasons. The Yii2 framework provides a wrapper,
yiisoft/yii2-swiftmailer, for the established library
Create a new application by using composer, as described in the official guide at http://www.yiiframework.com/doc-2.0/guide-start-installation.html.
Both basic and advanced applications contain this extension out of the box.
How to do it…
Now we will try to send any kind of e-mails from our own application.
Sending plain text e-mails
- Set the mailer configuration into the
'components' => [ // ... 'mailer' => [ 'class' => 'yii\swiftmailer\Mailer', 'useFileTransport' => true, ], ...