【问题标题】:Emails, setting the charset (Hotmail)电子邮件,设置字符集 (Hotmail)
【发布时间】:2013-09-26 20:19:07
【问题描述】:

我正在使用 PHPMailer 发送电子邮件。我正在通过电子邮件发送价格,它在 Gmail 和 Roundcube 上运行良好,但在 Hotmail 上,我的“£”符号显示为“£”。

我知道这是因为字符集设置不正确。我试过了

$mail->Body = "
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
</head>
<body>
$content
</body>
</html>
";

但 Hotmail 似乎像大多数电子邮件客户端一样剥离了标题。

如何确保我的“£”符号在不同的电子邮件客户端中正确显示?

【问题讨论】:

  • 您需要标题Content-type: text/html; charset="utf-8"。我不太了解 PHPMailer API,无法展示如何执行此操作。邮件阅读器不会使用 META 标签。

标签: php email hotmail


【解决方案1】:

您应该使用以下行来设置 charSet。

$mail->CharSet = 'UTF-8';

【讨论】:

    猜你喜欢
    • 2017-07-04
    • 1970-01-01
    • 1970-01-01
    • 2017-08-31
    • 2012-02-16
    • 2016-02-26
    • 2018-10-13
    • 1970-01-01
    • 2016-02-22
    相关资源
    最近更新 更多