<?php if (isset ($_POST['submit'])&& ($_POST['submit']!='')){
$to = 'manojpraharsha@gmail.com';
$subject = 'Website Enquery Request';
$email = $_POST['email'];
$name = $_POST['name'];
$headers = 'From: Timespaces <'.$to.'>' . "\r\n";
$headers .= 'Reply-To: '.$name.' <'.$email.'> ' . "\r\n";
$headers .= 'Return-Path:' .$to . "\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-Type: text/html; charset=ISO-8859-1' . "\r\n";
$message .= '<html><body>';
$message .= '<table rules="all" style="border-color:rgb(130,0,67);" cellpadding="10">';
$message .= "<tr style='background: #eee;'><td><strong>Name:</strong> </td><td>" . strip_tags($_POST['name']) . "</td></tr>";
$message .= "<tr><td><strong>Email:</strong> </td><td>" . $email . "</td></tr>";
$message .= "<tr><td><strong>Phone:</strong> </td><td>" . strip_tags($_POST['phone']) . "</td></tr>";
$message .= "<tr><td><strong>Subject:</strong> </td><td>" . strip_tags($_POST['subject']) . "</td></tr>";
$message .= "</table>";
$message .= "</body></html>";
mail($to, $subject, $message, $headers);
}
?>
这里是否有任何错误,我尝试了所有可能性,但所有邮件都转到我的垃圾邮件
答案 0 :(得分:1)
您可以PHP Mailer
使用SMTP
身份验证,或使用专用IP与热门(在通话对话中)发件人电子邮件ID进行发送