PHPmailer的smtp方式发送邮件

浏览:4377 最后更新:2016-08-02 10:58 分类:类库 关键字: PHPMailer
使用PHPmailer发送邮件,目前只是使用了smtp方式发送,但是下面的包中包含了别的方式的发送,只是我没有去实现

这个类的使用主要在common模块的function.php中实现,实现方式如下
Vendor("SmtpMailer");
$mail=new \SmtpMailer();
$res=$mail->send($sendname,$receivename,$email,$title,$content);
if($res['status']==1){
//说明发送成功!
}else{
//说明发送失败!
}
以上看出我将PHPMailer文件夹放在了vendor目录下,并且在Vendor根目录建立了一个叫SmtpMailer.php的文件,然后通过上面的代码引入并发送文件。

当然其中还有个config.php文件,也是把其中的配置放到common模块的config.php中
评论( 相关
后面还有条评论,点击查看>>