abiodun/mailswifter
Composer 安装命令:
composer require abiodun/mailswifter
包简介
Mail swifter is a free mailer built on swiftmailer for html template injection and data parser
关键字:
README 文档
README
Mail swifter is a free mailer built on swiftmailer for html template injection and data parser.
Installation
composer require abiodun/mailswifter
Usage
use Abiodun\MailSwifter\MailProvider
index.php
$mail_provider = new MailProvider([ 'username' => 'username@gmail.com', 'password' => 'password', 'smtp' => 'smtp.gmail.com', ]); $mail_provider->from = ['username@gmail.com' => 'Testing MailSwifter']; $mail_provider->to = ['username@gmail.com', 'username@gmail.com' => 'Mailing']; $mail_provider->subject = 'New Mail Test'; $file = __DIR__ . '/sample.html'; $data_list = [ 'name' => ' ', 'url' => 'http://info.google.com', 'category' => 'Fashion', ]; $resp = $mail_provider->template($file, $data_list); $resp = $mail_provider->send();
sample.html
<h1>This is a sample for the mail </h1> <p> i surely believe this would work so well</p> <p>Name is: [name] </p> <p>Url: [url]</p> <p>Category: [category]</p> <p>i'm so happy here </p>
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-06-18