php Mail()和Outlook
发布时间:2020-05-25 09:23:23 所属栏目:PHP 来源:互联网
导读:我有以下代码: $subject = Test Email; $from = noreply@bob.com; ini_set(sendmail_from, $from);$message = htmlbody bgcolor=#DCEEFC Hellobrbr This is
|
我有以下代码: $subject = "Test Email";
$from = "noreply@bob.com";
ini_set("sendmail_from",$from);
$message = "<html><body bgcolor="#DCEEFC">
Hello<br><br>
This is a <b>test</b> email.
<br><br><hr>
<a href="">Click Here</a>
<br><br><hr>
<br><br>
Thank you for your time,<br><br>
</body></html>";
$headers = "MIME-Version: 1.0rn";
$headers .= "Content-type: text/htmlrn";
$headers .= "From: " . $from . "rn";
mail($mail,$subject,$message,$headers);
但是,当我向自己发送电子邮件时,我会在Outlook中看到所有代码.如果我将其发送给其他人,他们会看到HTML.如果我将它发送到我的hotmail,他们会看到HTML. 这是我的展望(2007)的问题,如果是,它是什么,或者我可以在电子邮件中做些什么来保证它正确显示? 请帮忙! 我发现了问题:HTML Email not displaying correctly for Godaddy web based mail 更改: $headers = "MIME-Version: 1.0rn"; $headers .= "Content-type: text/htmlrn"; $headers .= "From: " . $from . "rn"; 至: $headers = "MIME-Version: 1.0" . PHP_EOL; $headers .= "Content-Type: text/html; charset=ISO-8859-1" . PHP_EOL; $headers .= "From: Site<$from>" . PHP_EOL; 谢谢你们的帮助! (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
