Forum Moderators: coopster
Here is my code:
<?php
$to = "test@test.com";
$from = "From: contact-form@test.com\n";
mail($to, $_POST["contact-name"], $_POST["contact-email"], $_POST["contact-subject"], $_POST["contact-message"], $from);
?>
<?php
$to = $_POST["contact-email"];
$fromemail = "contact-form@test.com";
$headers .= "From: $fromemail\n";
$headers .= "X-Sender: $fromemail\n";
$headers .= "X-Mailer: PHP\n"; //mailer
$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
$headers .= "Return-Path: $fromemail\n";
$headers .= "Reply-To: $fromemail\n";
$message = $_POST["contact-message"];
$subject = $_POST["contact-subject"];
mail($to, $subject, $message, $from);
?>
I don't know what you want to do with $_POST["contact-name"] but you could add that into the message maybe.