云邮件

免费
类型 应用插件
版本 1.0.1
版本更新时间 2023-03-04
大小 18.17 KB
开发商
官方
评分

详细介绍

邮件应用插件,支持在webman-admin中设置账号信息。用于向用户发送邮件,例如产品推广、邮箱验证等。

提供的接口

快速发送

use plugin\email\api\Email;
Email::send($from, $to, $subject, $content);

按照模版发送

提示
v1.0.1新增

use plugin\email\api\Email;
Email::sendByTemplate($to, $templateName, array $templateData = [])

模版可在邮件后台添加

自定义发送

use plugin\email\api\Email;
$mailer = Email::getMailer();
$mailer->setFrom('from@example.com', 'Mailer');
$mailer->addAddress('joe@example.net', 'Joe User');     // 增加一个接受者
$mailer->addAddress('ellen@example.com');                 // 名字是可选的
$mailer->addReplyTo('info@example.com', 'Information');
$mailer->addCC('cc@example.com');
$mailer->addBCC('bcc@example.com');

// 附件
$mailer->addAttachment('/var/tmp/file.tar.gz');             // 添加附件
$mailer->addAttachment('/tmp/image.jpg', 'new.jpg');    // 附件名是可选的

// 内容
$mailer->isHTML(true);                                                   // 如果内容是html
$mailer->Subject = 'Here is the subject';
$mailer->Body    = 'This is the HTML message body <b>in bold!</b>';
$mailer->AltBody = 'This is the body in plain text for non-HTML mail clients';

$mailer->send();

安装使用

请在webman-admin的插件市场安装

注意
此插件依赖 phpmailer/phpmailer
执行命令 composer require phpmailer/phpmailer安装(需要restart重启)

版本历史记录
1.0.1
2023-03-04
增加模版功能
1.0.0
2023-02-28
支持webman-admin后台设置账户信息
评分及评论
5 满分5分
zhezhebie 2024-01-08
感谢大佬!请问这个里面可以用复杂模板吗?例如,我想发送股票信息,需要用到if和遍历,还是说需要自己写,有参照的吗?谢谢
tl54577 2023-10-21
二进制打包以后,使用不了,提示 SMTP ERROR: Failed to connect to server: (0) 2023-10-21 14:36:37 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
mincon 2023-08-27
sendByTemplate 没有发送人别名 Email::send(接收配置信息) $config = static::getConfig(); static::send($config, $to, $subject, $content); call_user_func_array([$mailer, 'setFrom'], [$from['Username'], $from['From']]);
inmers 2023-03-23
请问有碰到中文乱码问题的吗?
OhMangoCat 2023-03-21
好用
peterli 2023-03-02
方便极了
🔝