0

我有一个很长的表格,表格的内容是通过邮件(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";
4

1 回答 1

0

如果您的mail()函数调用返回 FALSE 并且您没有收到 PHP 错误,那么这表明您的邮件服务器有问题。消息正在发送到邮件服务器,但由于某种原因未被接受。确切的原因取决于您的 PHP 服务器和邮件服务器的配置,因此您必须检查邮件服务器的日志以了解发生了什么。请参阅如何获取 mail() 函数的错误消息?

于 2013-10-29T21:20:47.833 回答