PHP利用qq邮箱发邮件
1.下载代码源码 https://github.com/PHPMailer/PHPMailer 2.在代码中放入composer.phar 安装phpmailer/phpmailer 3.到qq邮箱配置 开启SMTP服务 4.记住授权码 4.下载好phpmailer 后只需要几个重要的文件即可,其余的都可以删除 class.phpmailer.php class.pos3.php class.smtp.php 4.将这三个文件重新放置 有用的只有圈起来的三部分 5.编写发送邮件代码,封装在functions.php <?php /** * Created by PhpStorm. * User: xym * Date: 2018/7/27 * Time: 下午3:28 */ /*发送邮件方法 *@param $to: 接收者 $title: 标题 $content: 邮件内容 *@return bool true: 发送成功 false: 发送失败 */ function sendMail($to, $title, $content) { //引入PHPMailer的核心文件 使用require_once包含避免出现PHPMailer类重复定义的警告 require_once("phpmailer/class.phpmailer.php"); require_once(