Skip to content

Instantly share code, notes, and snippets.

/sentmail code Secret

Created August 9, 2014 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/f56ba67145d500c5cf47 to your computer and use it in GitHub Desktop.
Save anonymous/f56ba67145d500c5cf47 to your computer and use it in GitHub Desktop.
// Receiving variables
@$email = addslashes($_POST['email']);
@$kontakt = addslashes($_POST['kontakt']);
// Validation
if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
{
header("Location: error.html");
exit;
}
if (strlen($email) == 0 )
{
header("Location: error.html");
exit;
}
if (strlen($kontakt) == 0 )
{
header("Location: error.html");
exit;
}
//Sending Email to form owner
$pfw_header = "From: $email\n"
. "Reply-To: $email\n";
$pfw_subject = "kontakt";
$pfw_email_to = "_______@gmail.com";
$pfw_message = "$kontakt\n";
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
header("Location: result.html");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment