<?php
function is_valid_email($from_email)
{
return preg_match('#^[a-z0-9.!\#$%&\'*+-/=?^_`{|}~]+@([0-9.]+|([^\s\'"<>]+\.+[a-z]{2,6}))$#si', $from_email);
}
$to_email = "xxxxxx@hotmail.com";
$subject = "A Teens Life";
$name.=$_POST['name']."\n" ;
$from_email.=$_POST['from_email']."\n" ;
$msg.=$_POST['message']."\n" ;
$message = "
Name:
$name
Email:
$from_email
Message:
$msg
";
$sent = mail($to_email, $subject, $message) ;
if($sent)
{print "Your mail was sent successfully."; }
else
{print "We encountered an error sending your mail"; }
?>
</p>
<p><br>
<a href="contact.html">Click here to go back to the previous page </a></p>