·您现在的位置: 云翼网络 >> 文章中心 >> 网站建设 >> 网站建设开发 >> php网站开发 >> 新测thinkphp3.2整合PHPMailer发送邮件

新测thinkphp3.2整合PHPMailer发送邮件

作者:佚名      php网站开发编辑:admin      更新时间:2022-07-23

phpMailer 的官方网站:http://phpmailer.worxware.com/

PHPMailer 最新类库下载地址:【点击下载】

PHPMailer GitHub 下载地址:https://github.com/Synchro/PHPMailer,该页面也提供了使用例子,不过不是很全面。

参考 http://my.oschina.net/BearCatYN/blog/299192    的的博文

只选择了其中目录设置的部分

参考 http://jingyan.baidu.com/article/0bc808fc6498cd1bd585b95c.html   的文章
参考了里面的代码,和php.in 配置 

即使作完以上步骤,依然会报错 SMTP 类无法找到,只要在class.phpmailer.php中开头引入  

<?php
require_once("class.smtp.php");

就可以了。

smtp服务器:smtp.163.com
服务器用户名:[email protected]
服务器密码:   xxxxxx

 

163免费邮客户端设置的POP3、SMTP、IMAP地址

 

下面的设置可以调试SMTP错误信息

$mail->SMTPDebug = 3; // 关闭SMTP调试功能

// 1 = errors and messages

// 2 = messages only

$mail->ErrorInfo;    // 可以获取错误信息