如果我在HTML邮件中添加锚标记然后邮件发送显示失败,那么一切正常。
include("mail/class.phpmailer.php");
include("mail/class.smtp.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->CharSet="UTF-8";
$mail->SMTPSecure = 'tls';
$mail->Host = 'smtp.gmail.com';
$mail->Port = 587;
$mail->Username = 'user@gmail.com';
$mail->Password = 'password';
$mail->SMTPAuth = true;
$mail->From = 'user@gmail.com';
$mail->FromName = 'Naren';
$mail->AddAddress('xyz@gmail.com');
//$mail->AddReplyTo('xyz@gmail.com', 'Information');
$mail->IsHTML(true);
$mail->Subject = "code";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
$mail->Body = "<!DOCTYPE HTML><html>
<head>
<title>HTML email</title>
</head>
<body>
<p>Hello, This is test mail</p>
<a href='http://www.domain.com/changepassword.php?user_id=" .$User_id1."'>Create your password here</a>
</body>
</html>";
if(!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message has been sent";
}
如果我从主体中移除锚标签然后工作完美但是如果我添加锚标签,那么我收到一封邮件,邮件传递失败。你能帮帮我吗?
答案 0 :(得分:0)
您应该正确关闭“a href
”,忘了'
(单引号)
而不是:
<a href='http://www.domain.com/changepassword.php?user_id=" .$User_id1."'>
您应该使用:
<a href='http://www.domain.com/changepassword.php?user_id='" .$User_id1."'>
答案 1 :(得分:0)
最后,我找到了答案。我尝试了下面的代码,它对我来说非常适合。
$winImage.find('img').attr('data-original');