当前位置:网站首页>[symfony/mailer] An elegant and easy-to-use mail library
[symfony/mailer] An elegant and easy-to-use mail library
2022-08-02 03:52:00 【phpreturn】
Email seems to be outdated, but there are some scenarios where email notifications are still the most appropriate solution.
Compared with WeChat reminder and DingTalk reminder, email reminder is not limited to platforms, and has stronger content display capabilities, and various operating systems have powerful email clients. If we build an email server by ourselves, any sendingIt's all free, and we still deal with email a lot.
symfony/mailer is a new generation of mail manipulation library, using it to send mail is easier than writing database queries:
use Symfony\Component\Mailer\Transport;use Symfony\Component\Mailer\Mailer;$transport = Transport::fromDsn('smtp://localhost');$mailer = new Mailer($transport);$email = (new Email())->from('[email protected]')->to('[email protected]')//->cc('[email protected]')//->bcc('[email protected]')//->replyTo('[email protected]')//->priority(Email::PRIORITY_HIGH)->subject('Time for Symfony Mailer!')->text('Sending emails is fun again!')->html('See Twig integration for better HTML integration!
');$mailer->send($email);He supports standard mailbox protocols:
| smtp | smtp://user:[email protected]:25 | SMTP server |
| sendmail | sendmail://default | Use local email client to send |
| native | native://default | Email directory configured with php |
There are also popular mailbox service platforms built in:
| Amazon SES | composer require symfony/amazon-mailer |
| Gmail | composer require symfony/google-mailer |
| MailChimp | composer require symfony/mailchimp-mailer |
| Mailgun | composer require symfony/mailgun-mailer |
| Mailjet | composer require symfony/mailjet-mailer |
| Postmark | composer require symfony/postmark-mailer |
| SendGrid | composer require symfony/sendgrid-mailer |
| Sendinblue | composer require symfony/sendinblue-mailer |
| OhMySMTP | composer require symfony/oh-my-smtp-mailer |
It also has many advanced component operations built in, such as html templates, compiling css to inline styles, etc.is our go-to tool for sending emails.
边栏推荐
猜你喜欢
随机推荐
display,visibility,opacity
require modular syntax
js __proto__、prototype、constructor的关系
百度定位js API
C语言 void和void *(无类型指针)
查询数据库中所有表的索引,并且解析成sql
函数提升和变量提升
require模块化语法
阿里云服务器如何使用admin账户登录
第一篇博客
js 正则中 replace() 使用
阿里云设置域名解析重定向后,无法使用Chrome访问
URL URL
--fs模块--
vue3 访问数据库中的数据
如何查看一个现有的keil工程之前由什么版本的keil IDE编译
URL module
微信小程序云开发之券码领取,怎么防止用户领取到相同的数据?
如何根据地图上的两个坐标点来确定方向
meime module









