Mailer 1.0.0 and SwiftMailer 1.0.0
2021-07-05
811次浏览
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
- auth client
- view
- bootstrap
- html
- release
- redis
- apidoc
- Yii 2.0
- Yii 1.1
- mongodb
- mailer
- extensions
- twig
- gii
- queue
- runner
- http 客户端
- console
- validation
- sphinx
- cache
- widget
- translator
- hydrator
- error handler
- db
- symfonymailer
- log
- http
- config
- assets
- swiftmailer
- 图书
- imagine
- csrf
- elasticsearch
- swagger
- IDE
- i18n
- router
- definitions
- fastroute
- logging
- smarty
- user