Skip to content

Instantly share code, notes, and snippets.

@chadspencer
Created November 6, 2009 15:41
Show Gist options
  • Save chadspencer/228048 to your computer and use it in GitHub Desktop.
Save chadspencer/228048 to your computer and use it in GitHub Desktop.
<?php
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$messagesubject = $_POST['messagesubject'];
$message = $_POST['message'];
$msg .= "First Name: $firstname\n\n";
$msg .= "Last Name: $lastname\n\n";
$msg .= "Email Address: $email\n\n";
$msg .= "Phone: $phone\n\n";
$msg .= "Subject: $messagesubject\n\n";
$msg .= "Message: $message\n\n";
$subject = "Form Submission From Departika";
$to = "[email protected]";
$from = "[email protected]";
$mailheaders = "From: departika.com <$from>\n";
$mailheaders .= "Reply-To: $email\n\n";
$success = mail($to, $subject, $msg, $mailheaders);
if ($success)
header("Location: /contact/thanks/");
else
echo "An error occurred when sending the email to [email protected]. Please contact us directly.";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment