Skip to content

Instantly share code, notes, and snippets.

@joseph-farruggio
Created August 16, 2018 00:43
Show Gist options
  • Save joseph-farruggio/e568b58677202cc615fdb5c973347266 to your computer and use it in GitHub Desktop.
Save joseph-farruggio/e568b58677202cc615fdb5c973347266 to your computer and use it in GitHub Desktop.
<?php
if($_POST && isset($_POST['name'], $_POST['email'], $_POST['website'], $_POST['subject'], $_POST['message'])) {
//user posted variables
$name = strip_tags($_POST['name']);
$email = strip_tags($_POST['email']);
$website = strip_tags($_POST['website']);
$subject = strip_tags($_POST['subject']);
$message = strip_tags($_POST['message']);
//php mailer variables
$to = 'joey.farruggio@bizrocket.net';
$body = '
<html>
<body>
<b>Biz Rocket Contact Form</b>
<br /><br />
<b>Contact Details:</b><br />
Name: '.$name.'<br />
Email: '.$email.'<br />
Website: '.$website.'<br />
Message: '.$message.'<br /><br />
</body>
</html>
';
$headers = 'Content-Type: text/html; charset=UTF-8';
$headers .= 'From: '.$name.' <'.$email.'>';
// send email
mail( $to, $subject, $body, $headers );
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment