CMS自定义表单提交后,如何发送提醒邮件?
2 个回答
use app\common\library\Email;
/**
* 发送通知
* @param $params
* @return bool
*/
public function emsNotice($params)
{
$subject = '你收到一封新的邮件!';
$content = $params['msg'];
$email = new Email();
$result = $email->to($params['email'])
->subject($subject)
->message($content)
->send();
return $result;
}
@1095043198 请在Diyform.php
这个控制器的第121
行后添加
try {
$email = new \app\common\library\Email;
$result = $email
->to("收件人邮箱")
->subject("标题")
->message("消息内容")
->send();
} catch (\think\Exception $e) {
}
为啥我看不见..................