Reputation: 297
<?php if (isset ($_POST['submit'])&& ($_POST['submit']!='')){
$to = '[email protected]';
$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);
}
?>
is there any mistakes in here where i tried all possibilities but also all mails goes to my spam
Upvotes: 0
Views: 141
Reputation: 1988
You can use PHP Mailer
with SMTP
authentication, or send using dedicated IP with popular( in active conversation ) sender email ID
Upvotes: 1