mail.php
<?php
function goback()
{
header("refresh:5; url=index.php");
exit;
}
if(isset($_POST['submit'])){
$name = $_POST['name'];
$comment = $_POST['comment'];
$mob = $_POST['mob'];
$email= $_POST['email'];
$to ='[email protected]';
$subject= 'Request callback form';
$message ="Name: ".$name."\n".
"Comment: ".$comment."\n".
"Mobile: ".$mob."\n".
"E-mail: ".$email;
if(mail($to, $subject, $message)){
echo "Sent successfully! Thank you. ".$name.
", We will contact you soon!";
goback();
}
else
{
echo "something went wrong";
}
}
?>
I am getting email from this form if I set email id to [email protected] or [email protected], But if I set it to [email protected] then I didnt received any mail from contact us form ...
can anyone help to fix this?
any setting required in outlook like in gmail we have to set it to "less security" ??
you should use headers as well or you can use PHPMailer/SMTP (https://github.com/PHPMailer/PHPMailer) as well