kaadon / phpmailer
Kaadon phpmailer for PHP
Installs: 71
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:HTML
Requires
- php: >=7.2
- symfony/google-mailer: ^5.4
- twig/twig: ^3.4
This package is auto-updated.
Last update: 2024-10-29 08:52:50 UTC
README
phpmailer-
配置
-
thinkphp配置
//在config/kaadon中添加如下配置 "phpmailer" => [ "gmail" => [ "username" => "", "password" => "" ] ] // thinkphp中使用 Kaadon\PhpMailer\think\ThinkGmail 类 // 增加了 sendTemplateVerificationCode 发送方法,使用数据见 example
-
-
文字用法
$GM = (new \Kaadon\PhpMailer\GmailSender([ "username" => "usdtcloud@gmail.com", "password" => "" ])); $GM->setTo("kaadon.com@gmail.com")->setText("123456")->Send();
-
模板用法
$context = [ "server" => [ "member" => "ipioonet@gmail.com", "time" => date("Y-m-d H:i:s"), "node" => "韩国", "ip" => "103.86.47.17", "payment_method" => "按月支付", "payment_price" => "US$29", ] ]; $GM = (new \Kaadon\PhpMailer\GmailSender([ "username" => "aaaa@gmail.com", "password" => ""//密码 ])); $GM->setTo("aaa@gmail.com") ->setSubject("服务续费通知") ->setTwigTemplates("/Volumes/SourceData/composer/phpmailer/twig_templates","product.html",$context) ->Send()