I am trying to send a mail using php but mail is not showing on my gmail. $mail return true
. I am using hmailserver and WAMP. any help would be appreciated.
$to = $_POST['to'];
$message = $_POST['Message'];
$from = $_POST['from'];
$cc = $_POST['cc'];
//$headers = "From: ".$_POST['from']."
"."CC: ".$_POST['cc'];
$headers = 'From: Sigma Web Site <'.$_POST['from'].'>' . "
" . 'Reply-To: ' .$_POST['cc']. "
";
ini_set("sendmail_from", "iit@yahoo.com");
$mail = mail( $to, "Mail", $message, $headers);
echo($mail);
if($mail)
{
echo "Thank you for using our mail form";
}
else
{
echo "Mail sending failed.";
}
}
Try this ;).
$emailFROM = $_POST['from'];
$for = $_POST['to'];
$sub = "Subject";
$mes = $_POST['Message'];
if(Mail($for, $sub, $mes, "From: " . $emailFROM))
{
echo "(OK| <pre>$emailFROM<b>$for</b> - <b>$sub</b> - <b>$mes</b></pre>)";
} else {
echo "(Error)";
}