我正在开发一个 Wordpress 插件,在该插件中我使用 PHP 邮件功能发送电子邮件。在电子邮件正文中,我正在制作一个超链接。我正在 Windows 8 Mail App 中检查已发送的电子邮件。在电子邮件中,我看不到超链接,它只是纯文本。为什么会这样?我正在使用以下代码发送电子邮件:
ini_set("include_path", ".:/PHPMailer_5.2.4/");
require_once("../../../PHPMailer_5.2.4/class.phpmailer.php");
global $wpdb;
$to = "Receiver email"; // change this address with yours
$subject = "subject";
$name="name";
$from="name@domain.com";
$message = "<p>Please <a href='www.domain.com/unsubscribe.php?".$to."' target='_blank' onclick='unsubscribe_js($to);'>click here</a> to unsubscribe, if you don't want to getting more emails from us.</p>";
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "mail.domain.com"; // SMTP server
$mail->SMTPAuth = true;
$mail->Username = "user@domain.com";
$mail->Password = "Password";
$mail->FromName = $name;
$mail->From = $from;
$mail->AddAddress($to);
$mail->Subject = $subject;
$mail->MsgHTML($message);
$mail->WordWrap = 50;
$mail->Send();
我将“单击此处”设置为超链接,但它在 Windows 8 邮件应用程序中显示为纯文本。你能提出任何解决方案吗?