As the subject says I'm not able to get a contact form to correctly email me. I read through several forums on here and through the wiki and still can not get it to work.
My to email is set to "email@example.com" (My dreamhost hosted email).
My from email I have tried both my ftp "######@bergenia.dreamhost.com" and another dreamhost hosted email "firstname.lastname@example.org".
None of the above worked for me.
Below is the extremely simple code I'm using:
(At present I don't care about the ease of hijacking)
// EDIT THE 2 LINES BELOW AS REQUIRED
$to_email = "email@example.com";
$email_subject = "Website Message!";
$your_email = "firstname.lastname@example.org";
$first_name = $_POST['first_name']; // required
$email_from = $_POST['email']; // required
$comments = $_POST['comments']; // required
$header = "From: " . $your_email . "\r\n";
$header .= "Reply-To: " . $email_from . "\r\n";
$header .= "X-Mailer: PHP/".phpversion();
$email_message = "Form details below.\n\n";
$email_message .= "First Name: ".clean_string($first_name)."\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
$email_message .= "Comments: ".clean_string($comments)."\n";
// create email headers
mail($to_email, $email_subject, $email_message, $header);
You can view the page online at:
I'm using dreamhost hosted emails so I really don't understand why I cant figure this out, I would greatly appreciate any help you all can provide!