【问题标题】:Iphone Mail not displaying message correctly from PHPIphone Mail 无法正确显示来自 PHP 的消息
【发布时间】:2019-03-01 13:33:22
【问题描述】:

我有一个网站联系表格,可以将带有照片附件的 HTML 电子邮件作为电子邮件发送到 Iphone 邮件应用程序。我在 Iphone 上收到以下错误消息:

“此邮件因格式原因无法显示。请发件人使用不同的格式或电子邮件程序再次发送。多部分/混合”。

有人可以帮忙吗?

$headers = "MIME-Version: 1.0\r\n";
$headers .= "From:".$from_email."\r\n";
$headers .= "From:".$from_email."\r\n";
$headers .= "Reply-To: ".$sender_email."" . "\r\n"; 
$headers .= "Content-Type: multipart/mixed; boundary = 
$boundary\r\n\r\n";
$body = "--$boundary\r\n";
$body .= "Content-Type: text/plain; charset=ISO-8859-1\r\n";
$body .= "Content-Transfer-Encoding: base64\r\n\r\n";
$body .= chunk_split(base64_encode($message_body));
$sentMail = mail($recipient_email, $subject, $body, $headers);

【问题讨论】:

    标签: php html iphone


    【解决方案1】:

    更改正文内容类型:

    $body .= "Content-Type: text/html;"
    

    【讨论】:

    • 当我使用你的代码时,现在只显示图像,不再显示正文。还有其他建议吗?
    猜你喜欢
    • 1970-01-01
    • 2016-03-28
    • 1970-01-01
    • 2016-04-15
    • 2019-05-06
    • 2016-12-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-14
    相关资源
    最近更新 更多