20,359
社区成员
发帖
与我相关
我的任务
分享
$to ="**@***.com";//发往哪
$from ="**@***.com";//从哪发
$cc= "***@***.com";//抄送
$subject ="标题你好";//标题
//内容
$content =<<<HTML
<html>
<head></head>
<body>
<h1>hello</h1>
</body>
</html>
HTML;
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
$headers .= "To: $to \r\n";
$headers .= "Cc: $cc \r\n";
$headers .= "From: $from" . "\r\n";
$result = mail($to, $subject, $content, $headers);
if($result)
{
$ok.='OK'."<br />";
}
else
{
$ok.='no'."<br />";
}
echo $ok;
//很有可能发到垃圾箱