使用php mail()但邮件进入垃圾邮箱

时间:2017-06-17 13:02:47

标签: php email

我使用这个简单的php mail()函数在gmail上发送邮件。但是这封电子邮件是垃圾邮箱。请帮我解决这个问题

<?php
$to = "delhisadarbazaar@gmail.com";
$subject = "HTML email";

$message = "
<html>
<head>
<title>HTML email</title>
</head>
<body>
<p>This email contains HTML Tags!</p>
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
</tr>
</table>
</body>
</html>
";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: <raman.singh9718@gmail.com>' . "\r\n";
$headers .= 'Cc: raman.singh9718@gmail.com' . "\r\n";
mail($to,$subject,$message,$headers);
?>

0 个答案:

没有答案