Php mail() not sending

I’m using an email form on my web site:

The php mail() function worked for the first few test emails but then stopped sending because I didn’t have the from header set correctly.

I have since changed the php code to the dreamhost recommended code:

$to_email =;
$your_email =;
$header = "From: " . $your_email . “\r\n”;
$header .= "Reply-To: " . $visitor_email . “\r\n”;
$subject = "Contact Form Submission from " . $visitor_name;
$emailMessage = "Name: " . $visitor_name . “\r\n”;
$emailMessage .= "Email: " . $visitor_email . “\r\n”;
$emailMessage .= "Message: " $message . “\r\n”;
mail($to_email, $subject, $emailMessage, $header);

but email is still not sending and it’s also not showing up in Maildir.
Is it possible that my to_email is now on a dreamhost spoofing black list?

You did change ‘’ to a valid email address correct?
and the $to_email was also set to a email address?

Yes, I didn’t want to post the real addresses here for every bot on the net to scrap. I’m still waiting for a response from dreamhost.

You haven’t put the From: address in the mail() call. Give that a try.

Yes, I’ve already done this. Initially I was putting the Site Visitors email in the from address which triggered the stoppage but now that I’ve changed the from address to the dreamhost recommended method it’s still not working. No mail can be sent via the php mail() function from my dreamhosted site. I’m still waiting for a response from dreamhost.

Having the same issue – all previously working php mail() forms stopped working. The last submission I got was 12:41pm EST yesterday (Thursday). Subsequent test submissions have not shown up. I don’t know how much delay there is before reaching maildir, but they’re not in there.

EDIT: As I submitted this, a form submission from 10:15 this morning came through (a few hours late). Hoping the rest will show up.

Could be mail queueing up.

It’s a good idea to use the -f switch in the mail() function to avoid any problems with $header parsing.