Skip to content

Instantly share code, notes, and snippets.

@BluePraise
Created April 18, 2017 13:56
Show Gist options
  • Save BluePraise/15d658e9b5f1c63cee10dd42f72620b2 to your computer and use it in GitHub Desktop.
Save BluePraise/15d658e9b5f1c63cee10dd42f72620b2 to your computer and use it in GitHub Desktop.
<?php
$sendto = "email@email.com";
$subject = "Email from Your Website";
$name = $_POST['name'];
$email = $_POST['email'];
$project = $_POST['project'];
$message = $_POST['message'];
// Header
$headers = "From: Boo!" . strip_tags($usermail) . "\r\n";
$headers .= "Reply-To: ". strip_tags($usermail) . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html;charset=utf-8 \r\n";
// Body
$msg = "<html><body style='font-family:Arial,sans-serif;'>";
$msg .= "<h2 style='font-weight:bold;border-bottom:1px dotted #ccc;'>$subject</h2>\r\n";
$msg .= "<p><strong>Name: </strong> ".$name."</p>\r\n";
$msg .= "<p><strong>Email: </strong> ".$email."</p>\r\n";
$msg .= "<p><strong>Project: </strong> ".$project."</p>\r\n"; <<<<<----- I added this
$msg .= "<p><strong>Message: </strong> ".$message."</p>\r\n";
$msg .= "</body></html>";
// send
if(@mail($sendto, $subject, $msg, $headers)){
$_POST['hidden'] = "";
echo "true";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment