Php mail function


#1

Hello all! I’m moving a website from my old service provider over to dreamhost. My website calls the php mail function to send an email when a customer submits an order. This function is failing on dreamhost. Is SendMail not installed?

Thanks!


#2

Sendmail is installed and it’s possible to mail via PHP. What’s your PHP syntax for sending the message?

-Scott


#3

Hi Scott, here’s my syntax. Again, this worked on my old provider; however I fully realize different versions of PHP, etc work a little differently.

$recipient = “Name name@domain.com”;
$subject = “Hey, a new order!”;
$message = “Check it out, a new order!”;
$extra = “From: Webmasterwebmaster@domain.com\r\nReply-To: webmaster@domain.com\r\n”;

mail ($recipient, $subject, $message, $extra);


#4

Take off the \r\n from the last header (Reply-To). You only need those to separate headers, and there’s no header after that, so that creates a blank line in the header which throws things off.

-Scott