Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 雅虎的邮件格式不正确_Php_Email - Fatal编程技术网

Php 雅虎的邮件格式不正确

Php 雅虎的邮件格式不正确,php,email,Php,Email,当用户注册或单击“忘记密码”时,将发送邮件。它在gmail和其他账户中看起来不错,但在yahoo中以html格式显示 代码为 $embody="<p>Dear ".$data['name']." </p> <p> Thank you for registering with JCA Associates. Please log into your account to complete your candidate pr

当用户注册或单击“忘记密码”时,将发送邮件。它在gmail和其他账户中看起来不错,但在yahoo中以html格式显示

代码为

   $embody="<p>Dear ".$data['name']." </p>
                <p> Thank you for registering with JCA Associates.  Please log into your account to complete your candidate profile and upload your CV </p><br/>
                <p> JCA Associates</p>
                <p> <img src='".$_SERVER['HTTP_HOST']."/themes/images/logo.png' width='100' height='60'></p>";
                //} else {
                //  $embody="<p>Dear ".$data['name']." </p><p> Thank you for registration with us!</p><p> Best regards,<br/> JCA Team</p>";
                //}
                $message  = '<html dir="ltr" lang="en">' . "\n";
                $message .= '  <head>' . "\n";
                $message .= '    <title>Welcome to JCA Associates</title>' . "\n";
                $message .= '    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">' . "\n";
                $message .= '  </head>' . "\n";
                $message .= '  <body><p> ' . html_entity_decode($embody, ENT_QUOTES, 'UTF-8') . '</body>' . "\n";
                $message .= '</html>' . "\n";
$include=“亲爱的”。$data['name']

感谢您向JCA Associates注册。请登录您的帐户以完成您的候选人简介并上传您的简历 JCA协会

”; //}否则{ //$include=“亲爱的”$data['name']”“

感谢您在我们注册!

向您致意,
JCA团队

”; //} $message=''。“\n”; $message.=''。“\n”; $message.=“欢迎来到JCA Associates”。“\n”; $message.=''。“\n”; $message.=''。“\n”; $message.=''。html_实体_解码($include,ENT_引号,'UTF-8')。'。“\n”; $message.=''。“\n”;
雅虎就是这样展示的。

我猜您没有将HTML标题添加到触发电子邮件调用的函数中。如果您使用的是
邮件
,请添加以下标题:

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

mail($to, $subject, $message, $headers);

其中
$subject
$to
$headers
具有适当的值。

我猜您尚未将HTML头添加到触发电子邮件调用的函数中。如果您使用的是
邮件
,请添加以下标题:

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

mail($to, $subject, $message, $headers);

其中
$subject
$to
$headers
具有适当的值。

尝试将以下内容添加到您的电子邮件代码中,它将像一个符咒一样工作

$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=utf-8 \n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: PHP/"."MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html\n";
mail("$sendto","$subject","$embody","$headers","$from");

尝试将以下内容添加到您的电子邮件代码中,它将像一个符咒一样工作

$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=utf-8 \n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: PHP/"."MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html\n";
mail("$sendto","$subject","$embody","$headers","$from");

完整邮件发送代码为?完整邮件发送代码为?