【发布时间】:2019-07-22 20:23:48
【问题描述】:
我有一个网站联系表,它以电子邮件的形式发送到我的 iPhone。问题是我收到以下消息: “此邮件因格式原因无法显示。请发件人使用不同的格式或电子邮件程序再次发送。multipart/mixed”
这是否与电子邮件内容类型以及如何在我的 PHP 代码中修复它有关。
$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);
【问题讨论】: