localhost php邮件程序工作不正常
试着使用一些工具,比如。如果未设置本地邮件,则使用PHP邮件处理程序。因此,安装此工具并打开它,它在端口25上工作。不要滥用黑体字。这对任何人都没有帮助localhost php邮件程序工作不正常,php,phpmailer,Php,Phpmailer,试着使用一些工具,比如。如果未设置本地邮件,则使用PHP邮件处理程序。因此,安装此工具并打开它,它在端口25上工作。不要滥用黑体字。这对任何人都没有帮助 require 'PHPMailer/PHPMailerAutoload.php'; $mail = new PHPMailer(); $mail ->IsSmtp(); $mail ->SMTPDebug = 0; $mail ->SMTPAuth = true;
require 'PHPMailer/PHPMailerAutoload.php';
$mail = new PHPMailer();
$mail ->IsSmtp();
$mail ->SMTPDebug = 0;
$mail ->SMTPAuth = true;
$mail ->SMTPSecure = 'ssl';
$mail ->Host = "smtp.gmail.com";
$mail ->Port = 465; // or 587
$mail ->IsHTML(true);
$mail ->Username = "yourmail@gmail.com";
$mail ->Password = "Wearethebest";
$mail ->SetFrom("yourmail@gmail.com");
$mail ->Subject = "Learn forgot password";
$mail ->Body = $mailMsg;
$mail ->AddAddress($for_email);
if(!$mail->Send())
{
echo "Mail Not Sent";
}
else
{
echo "Mail Sent";
}