napoleon / omnismtp-sendgrid
SMTP处理库的Sendgrid驱动
0.2
2020-08-25 08:14 UTC
Requires
- php: >=7.3.0
- crazymeeks/omnismtp: dev-master
- sendgrid/sendgrid: ~7
Requires (Dev)
- phpunit/phpunit: ^7.5.0
This package is auto-updated.
Last update: 2024-09-26 11:27:05 UTC
README
安装
composer require napoleon/omnismtp-sendgrid
如何使用
单个收件人
<?php $key = 'api-key'; $sendgrid = \OmniSmtp\OmniSmtp::create(\Napoleon\OmniSmtp\SendGrid::class, $key); $sendgrid->setSubject('The Mail Subject') ->setFrom('napoleon@example.com') ->setRecipients('testemail1@example.com') ->setContent('<p>Hello From SendGrid OmniMail</p>') ->send();
多个收件人
<?php $key = 'api-key'; $sendgrid = \OmniSmtp\OmniSmtp::create(\Napoleon\OmniSmtp\SendGrid::class, $key); $sendgrid->setSubject('The Mail Subject') ->setFrom('napoleon@example.com') ->setRecipients('testemail1@example.com', 'testemail2@example.com') ->setContent('<p>Hello From SendGrid OmniMail</p>') ->send();