You need a password to send mail. Be sure to enter it.';
$validpw = false;
} elseif($_POST['password'] != PASSWORD)
{
$mail = '
Invalid password.
';
$validpw = false;
} else {
$validpw = true;
}
if(isset($_POST['to']) && isset($_POST['from']) && isset($_POST['fromname']) && isset($_POST['replyto']) && isset($_POST['subject']) && isset($_POST['message']) && $validpw)
{
$headers = 'From: '.$_POST['fromname'].' <'.$_POST['from'].'>' . "\r\n" .
'Reply-To: '. $_POST['replyto'] . "\r\n";
$mail = mail($_POST['to'],$_POST['subject'],$_POST['message'],$headers);
if($mail)
{
$mail = 'Mail sent.
';
} else {
$mail = 'Error
';
}
} else {
if(!isset($mail))
{
$mail = 'Fill in all inputs
';
}
}
?>
Email Sender