|
mail codes
I try to use E-mail system. I want you to check my code.
my php is 4.2
my php editor says "$from .="<". $mailadr .">";
mail($sendto, $subject, $msg, $from);" These lines are wrong.
I tested so many times.
It is not working
Thank you for your time
<?php
$sendto = "itohideo@domaindlx.com";
$yourname = $_POST["yourname"];
$mailadrs = $_POST["mailadrs"];
$subject = $_POST["subject"];
$msg = $_POST["msg"];
$no = 0;
if ($yourname == "") {
print("Please Enter your Name<br>\n");
$no = 1;
}
if ($mailadrs == "") {
print("Please Enter your mailad<br>\n");
$no = 1;
}
if($subject == "") {
print("Please Enter your title<br>\n");
$no = 1;
}
if ($msg == "") {
print("Please Enter your comments<br>\n");
$no = 1;
}
if ($no != 1) {
$from = "From:" .$yourname. "\n";
$from .="<". $mailadr .">";
mail($sendto, $subject, $msg, $from);
} else {
echo "Mail did not send.";
}
?>
|