【发布时间】:2013-11-09 05:59:57
【问题描述】:
我有一个很长的表格,表格的内容是通过邮件(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";
【问题讨论】:
-
定义“不工作”。
-
当我从
$body = ' ';部分删除代码时正在发送邮件,当我再次添加它时,邮件没有发送。 -
请发布您正在使用的代码以及正在生成的错误。
-
邮件代码只有大约 800 行,我没有收到任何错误消息。
-
那么您的
mail方法是什么样的?