当前位置:网站首页>[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.
边栏推荐
- FreeRTOS内核详解(1) —— 临界段保护原理
- 我的小笔记 =》其他东东
- Small program van-cell line wrapping can be left-aligned
- The Error in the render: "TypeError: always read the properties of null '0' (reading)" Error solution
- 批量替换文件字体,简体->繁体
- ES6数组的扩展方法map、filter、reduce、fill和数组遍历for…in for…of arr.forEach
- C语言 内联函数
- canvas--饼状图
- 微信小程序云开发之券码领取,怎么防止用户领取到相同的数据?
- easyswoole 使用redis执行geoRadiusByMember Count无效修复
猜你喜欢

微信小程序九宫格抽奖和转盘抽奖的实现

MySql高级 -- 约束

6.24今日学习

稳定好用的短连接生成平台,支持API批量生成

canvas--pie chart

ES6三点运算符、数组方法、字符串扩展方法

ES6数组的扩展方法map、filter、reduce、fill和数组遍历for…in for…of arr.forEach

微信小程序怎么批量生成带参数的小程序码?

The querystring module

Phospholipid-polyethylene glycol-targeted neovascularization targeting peptide APRPG, DSPE-PEG-APRPG
随机推荐
阿里云设置域名解析重定向后,无法使用Chrome访问
骨架效果 之高级渐变,适用图片等待时
C语言 内联函数
ES6三点运算符、数组方法、字符串扩展方法
npm --package.json---require
ES6介绍+定义变量+不同情况下箭头函数的this指向
解决uni-app 打包H5网站 下载图片问题
5.19今日学习
PHP的几个有趣的打开方式:从基本到变态
网址URL
mysql阶段总结
解决 Zlibrary 卡死/找不到域名/达到限额问题,Zlibrary最新地址
[league/climate]一个功能健全的命令行功能操作库
每日五道面试题总结 22/7/21
点名系统和数组元素为对象的排序求最大值和最小值
js作用域与闭包
DOM操作---放大镜案例
5.20今日学习
clock tick marks
6.27面试集