SMTP 邮箱是 wordpress 必备功能了,各种邮件通知、找回密码等,都要通过邮箱来搞~
只需在 functions.php 文件种添加一下代码:
//配置 SMTP
public function btbat_mail_smtp($phpmailer) {
$phpmailer->From = ""; //发件人地址 xxx@qq.com
$phpmailer->FromName = ""; //发件人昵称 随便
$phpmailer->Host = "";; //SMTP 服务器地址 比如 smtp.qq.com
$phpmailer->Port = "";; //SMTP 邮件发送端口 465,25
$phpmailer->SMTPSecure = 'ssl';//SMTP 加密方式(SSL/TLS)没有为空即可
$phpmailer->Username = ""; //邮箱帐号 你的 qq 邮箱
$phpmailer->Password = ""; //邮箱密码 见下方说明
$phpmailer->IsSMTP();
$phpmailer->SMTPAuth = true; //启用 SMTPAuth 服务
}
add_action('phpmailer_init', ('btbat_mail_smtp'));
以 QQ 为例,上面的邮箱密码,并不是 QQ 密码,而是进入 QQ 邮箱 - 设置 - 账户 - SMTP 服务 - 生成授权码


