Not recieving Mail from site contact form (Am using Dreamhost Servers)


#1

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 "craigbarnett@bhvfx.com" (My dreamhost hosted email).
My from email I have tried both my ftp “######@bergenia.dreamhost.com” and another dreamhost hosted email "admin@bhvfx.com".

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)

<?php // EDIT THE 2 LINES BELOW AS REQUIRED $to_email = "craigbarnett@bhvfx.com"; $email_subject = "Website Message!"; $your_email = "admin@bhvfx.com"; $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!


#2

mail($to_email, $email_subject, $email_message, $header);


#3

Sorry that mistake was just a result of trying so many different examples, I changed it to -> mail($to_email, $email_subject, $email_message, $header);
and it still doesn’t work, no mail is received.

:Edited the OP

Could it have anything to do with the domain name being registered on a different site? (Hover) Or that I’m using a CDN? (Cloudflare).

I would be surprised if that would affect it, but figured I’d point it out in case.

Even the following short code will not work for me:

mail(‘craigbarnett@bhvfx.com’, ‘My Subject’, ‘Test 1 2 3 4 5’, ‘From: admin@bhvfx.com’);

Both of the above are dreamhost hosted emails


#4

Wow… I accidentally had javascript blocking the submit button from activating the php -_-

If possible, can mods delete this thread?

I saw no button for it

Thanks!