Mailer 1.0.0 and SwiftMailer 1.0.0
2021-07-05
926次浏览
First releases of mailer package and its SwiftMailer adapter were released.
The mailer package provides the content composition functionality, and a basic interface for sending emails. Actual mail sending is provided by separate interchangeable packages.
The following code can be used to send an email:
/**
* @var \Yiisoft\Mailer\MailerInterface $mailer
*/
$message = $mailer->compose()
->withFrom('from@domain.com')
->withTo('to@domain.com')
->withSubject('Message subject')
->withTextBody('Plain text content')
->withHtmlBody('<b>HTML content</b>')
;
$mailer->send($message);
Out of the box the package profiles a file mailer that, instead of actually sending an email, writes its contents into a file. There is also SwiftMailer-based official driver available as a separate package that actually can send emails.
新闻归档
热门标签
- yii3
- 扩展
- 发布
- yii2
- debug
- view
- auth client
- html
- bootstrap
- release
- apidoc
- Yii 1.1
- redis
- Yii 2.0
- mongodb
- extensions
- mailer
- runner
- gii
- console
- http 客户端
- queue
- validation
- twig
- error handler
- hydrator
- http
- translator
- cache
- widget
- sphinx
- config
- symfonymailer
- assets
- db
- log
- router
- swagger
- swiftmailer
- elasticsearch
- 图书
- imagine
- fastroute
- rbac
- i18n
- IDE
- user
- definitions
- csrf
- widgets