mail()函数不会发送多行

时间:2014-07-11 03:38:56

标签: php html email

好的,我正在创建一个网站,并希望发送一封无回复电子邮件。如果我发送一个段落之间的消息,它会发送罚款。一旦我尝试发送超过一个段落的消息,该消息就不会到达我的收件箱。当我运行以下代码时,它运行为true但消息永远不会到达我的收件箱。

if (mail($to,$subject,$message,$headers)){
    echo "email sent successfully";
}

任何人都有这个问题吗?我尝试联系我的托管服务提供商,他们不知道为什么。

<?php
error_reporting(E_ALL ^ E_NOTICE); 
                $to = "VElicted8008@gustr.com";
$subject = "Welcome To PROJECTNAME (FAQ Included)";

$message = '<p>Hello YouTuber! </p><p>Hello YouTuber! </p>
<p>To begin, here are some FAQs: </p>
<p>......</p>
<p>Thank you again for registering! </p>';

// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

// More headers
$headers .= 'From: <no-reply@project-name.com>' . "\r\n";
if (mail($to,$subject,$message,$headers)){
    echo "email sent successfully";
}

?>

0 个答案:

没有答案