<?php
$email = mymail@hotmail.com;
$target = (stripslashes(trim($_POST['target'])));
$title = (stripslashes(trim($_POST['title'])));
$body = (stripslashes(trim($_POST['body'])));
$header = "From: $email\n";
$header .= "Content-type: text/html\n";
$regex="/^[a-zA-Z][\w \.\-]+[a-zA-Z0-9]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,4}$/";
if($target == "" || !preg_match($regex, $target)){
echo "<font color='red'><b> Error: No Target Email Provided or Email Invalid! </font></b>";
exit;
}
elseif($title == ""){
echo "<font color='red'><b> Error: No Email Title Provided! </font></b>";
exit;
}
elseif($body == ""){
echo "<font color='red'><b> Error: No Email Body Provided! </font></b>";
exit;
}
mail($target, $title, $body, $header);
echo "Mail Was Sent!";
?>