【问题标题】:html email is not displaying in proper format in email (except gmail) when I send it using php mail function当我使用 php 邮件功能发送时,html 电子邮件未在电子邮件中以正确的格式显示(gmail 除外)
【发布时间】:2015-09-23 08:58:09
【问题描述】:

我是 php 新手,正在尝试通过 php 邮件功能发送电子邮件。在 gmail 帐户中,电子邮件显示正常,但除了 gmail,我在电子邮件正文中收到了 html 标记作为文本。

这是我的代码 sn-p:

$headers  = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=ISO-8859-1' . "\r\n";

$headers .= "Reply-To:abc@abc.com" . "\r\n";

$headers .= "BCC: $bcc" . "\r\n";

$headers .= "From: $from" . "\r\n";

我正在使用的邮件功能是:

mail( $to, $subject, $body, $headers )

【问题讨论】:

  • 显示您的电子邮件模板

标签: php


【解决方案1】:

找到了解决方案,我刚刚将 '\r\n' 替换为 '\n' 并且它开始在每个邮箱中都能完美运行。

谢谢

【讨论】:

    猜你喜欢
    • 2012-12-29
    • 1970-01-01
    • 1970-01-01
    • 2012-02-04
    • 2012-12-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-23
    相关资源
    最近更新 更多