0

我试图嵌入一个

<a href="http://www.google.com/">Google</a>

例如。然而,在电子邮件中,它显示了所有的 html 代码。我认为这可能是出于安全原因,以避免网络钓鱼诈骗,例如让人们访问他们不打算访问的链接。这是我能想到的最佳方法,因为我正在传递敏感信息,并且只希望用户将链接视为“Google”一词。

注意:此处仅使用 google 作为示例。

4

2 回答 2

1

查看PHP 文档中的 Example #4mail

特别是这部分:

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
于 2013-07-11T11:00:21.327 回答
1

您是否设置了正确的标题?
直接来自 php.net

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

在这里查看更多,关于发送 html 电子邮件的示例 #4。

于 2013-07-11T11:00:45.003 回答