Page 1 of 1

Php Mail Bounce

Posted: Mon Oct 08, 2007 12:09 pm
by jandrews3
scottayy | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I am using a very simple script for emailing:

Code: Select all

$to = $row['email'];
$subject = "Bounce Test";
$body = "This is a php email bounce test.";
$headers = "From: jandrews@jamesa3.com\r\n" .
"X-Mailer: php".

if (mail($to, $subject, $body, $headers)) echo("<p>Sent.</p>");}
else {echo("<p>Message delivery failed...</p>");}
What I need is when any of the email addresses are not valid, I want it to bounce back to my email address "jandrews@jamesa3.com".
I have looked for examples online, but none of them seem to work. I tried adding:

Code: Select all

"Return-Path: detect-bounce@yourdomain.com\r\n",
&
"Return-Receipt-To: bounce@yourdomain.com\r\n"
... but the ampersand gave an error as did the comma. I then used a period instead of a comma and removed the ampersand ... still no positive results. I tried a variety of different configurations using this code with small changes each time.

This is a very important project for me. I would be very greatful for any help!!! Thank you!


scottayy | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Mon Oct 08, 2007 1:22 pm
by s.dot
Shouldn't you just be doing..

Code: Select all

$headers .= "Return-Path: detect-bounce@yourdomain.com\r\n";
$headers .= "Return-Receipt-To: bounce@yourdomain.com\r\n"

Posted: Mon Oct 08, 2007 1:34 pm
by jandrews3
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Yeah, I tried that. Unfortunately no help. I thought the following would solve my problems, but it didn't. I'm still at a loss.

Code: Select all

$headers = "From: jandrews@ithf.org\r\nReturn-Path: jandrews@jamesa3.com\r\nReturn-Receipt-To: jandrews@jamesa3.com\r\n";

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]