Bounced emails don't goto $sender POP account

Can someone tell me what I’m doing wrong? Frequently emails go out from my website to registered users. Sometimes those emails bounce. Instead of returning to my support@oil-testimonials.com POP account, they goto the root email account instead: myaccount@host363.hostmonster.com

Does anyone know what I’m doing wrong? Improperly formed headers?

Thanks!



$sender = "support@oil-testimonials.com";
$recipient = "someUser@domain.com";

$headers =  "From: Oil-Testimonials.com <$sender>\\r\
";
$headers .= "Reply-To: $sender\\r\
";

// Use wordwrap() if lines are longer than 70 characters
$message = wordwrap($message,70);

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

You need to add a Return-Path header. :slight_smile:

But isn’t that only applicable when using SMTP to send email? I’ve also read the following on another website:

“The Return-path header is supposed to be added by the server that makes the final delivery (when the message “leaves the SMTP world”, to quote RFC 821).”