shippinno/email
Composer 安装命令:
composer require shippinno/email
包简介
README 文档
README
Installation
$ composer require shippinno/email
Usage
Use a SendEmail to send an Email. It reattempts to send if $maxReattempts attribute is set.
use Shippinno\Email\SwiftMailer\SwiftMailerSendEmail; use Tanigami\ValueObjects\Web\Email; use Swift_Mailer; $sendEmail = new SwiftMailerSendEmail(new Swift_Mailer(...)); $sendEmail->execute( new Email(...), 3 // max reattempts );
Dealing with non RFC email address
Swift Mailer
Swift Mailer rejects Non RFC compliant email addresses by default.
You can set a custom email validator and Mime grammer (for Swift Mailer 5.x compatibility) allowing non RFC email address (e.g. email.@example.com) by calling allow_non_rfc_email_address(); function.
use function Shippinno\Email\SwiftMailer\register_swift_non_rfc_email_validator; allow_non_rfc_email_address(); (new Swift_Message)->setTo('email.@example.com'); // => OK
EmailAddress object
Tanigami\ValueObjects\Web\EmailAddress requires its value to be RFC compliant by default. You can have it soft validate by setting the second attribute of the constructor to true.
new EmailAddress('email..@example.com') // => InvalidArgumentException new EmailAddress('email..@example.com', true); // => OK
统计信息
- 总下载量: 2.15k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2018-11-02