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 POP account, they goto the root email account instead:

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


$sender = "";
$recipient = "";

$headers =  "From: <$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).”