I've been using PHP's mail() function in several of my programs. I didn't notice until recently that if an email is undeliverable it gets returned to my servers root mail account or root@localhost How do I get undeliverables to return to the email address in the mailheaders? Here's an example of my email headers:
$msg = "test";
$subject = "test";
$email = "me@mydomain.com";
$adminmailheaders = "From: $email\n";
$adminmailheaders .= "CC: $ccemail\n";
$adminmailheaders .= "BCC: $bccemail\n";
$adminmailheaders .= "Reply-To: $email\n";
$adminmailheaders .= "Return-Path: $email\n";
mail($email,$subject,$msg,$adminmailheaders);
mail() building headers.
Moderator: General Moderators
-
jasonrusso
- Forum Newbie
- Posts: 2
- Joined: Fri Feb 20, 2004 11:42 am
reply
That didn't work. Emails are still bouncing to my root email account. i noticed the return-path says: <> . Wierd. Never had this problem in Perl. I'm not alone though, I see other users on my server using PHP mail() and there's are bouncing to the root too.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK