我有一个很长的表格,表格的内容是通过邮件(HTML 电子邮件)发送的。
我的 PHP 邮件功能可以完美地处理其余内容。但是当我将以下内容添加到邮件正文时,邮件不起作用。
<h4><span style="text-decoration:underline">OCCUPATION:</span></h4>
<p>Please provide a specific and identifiable business activity and
your current position . Vague references such as"Businessman" or
"Manager" will not be accepted and will delay the incorporation
process. In the case of no employment please describe the normal
day to day activities such as "House Wife" In case of retirement
please provide details of previous occupation and your last
position.<br />
<textarea name="personal_information_occupation">
</textarea></p>
<hr />
我浏览了每一行,但找不到这些特定行的问题。
我的 PHP 邮件发送 HTML 电子邮件。
<?php
if(mail($to, $subject, $message, $headers)){
$mail_status_message = "<p class='success-msg'> Form Submitted Successfully. </p>";
}else{
$mail_status_message = "<p class='error-msg'> Something went wrong. Please try again later. </p>";
}
?>
基本上,Something went wrong. Please try again later
当我将上述代码添加到消息正文时,我得到了。
邮件标题是
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: '.$to_name.'<'.$to_email.'>' . "\r\n";
$headers .= 'From: Business Name <email@example.com>' . "\r\n";