Jump to content

Archived

This topic is now archived and is closed to further replies.

JasonORDSW

Detecting Bounced EMails

Recommended Posts

Can anyone help me?

I have a member profile system, and have php mail() generated emails that are sent to the members of the site.

I am trying to recode the site so that if an email is undeliverable, it then bounces back to my BOUNCE@domain_name.com address.

I then use this on the administrative side of the site to determine which accounts to flag, so when a user then logs onto the site, they are required to update thier email address before continuing on.

I have tried several attempts at different things, and have real A LOT of examples on php mail() but I am not able to have any luck.

Can anyone help? or provide a tutorial/examples of such coding?

THANKS!

Jason

Share this post


Link to post
Share on other sites
Does anyone have any commentson this? :)


[!--quoteo(post=377235:date=May 26 2006, 01:36 AM:name=JasonORDSW)--][div class=\'quotetop\']QUOTE(JasonORDSW @ May 26 2006, 01:36 AM) [snapback]377235[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Can anyone help me?

I have a member profile system, and have php mail() generated emails that are sent to the members of the site.

I am trying to recode the site so that if an email is undeliverable, it then bounces back to my BOUNCE@domain_name.com address.

I then use this on the administrative side of the site to determine which accounts to flag, so when a user then logs onto the site, they are required to update thier email address before continuing on.

I have tried several attempts at different things, and have real A LOT of examples on php mail() but I am not able to have any luck.

Can anyone help? or provide a tutorial/examples of such coding?

THANKS!

Jason
[/quote]

Share this post


Link to post
Share on other sites
you could always use If-Else stucture...

If(mail(.......)) {

It worker!

}
else{
Bad luck
}


Although this doesn't check if the email excists. But that's bad luck for the user then he :D

Share this post


Link to post
Share on other sites
As the [a href=\"http://www.php.net/manual/en/function.mail.php\" target=\"_blank\"]fine manual[/a] says:
[quote] Returns [b]TRUE[/b] if the mail was successfully accepted for delivery, [b]FALSE[/b] otherwise.

It is important to note that just because the mail was accepted for delivery, it does [b]NOT[/b] mean the mail will actually reach the intended destination. [/quote

What have you tried?

You can try setting the fifth parameter to the mail function to be the bounce address:
[code]<?php
$bounce = '-f BOUNCE@domain_name.com address';
mail($to,$subject,$message,$hdrs,$bounce);
?>[/code]

Ken

Share this post


Link to post
Share on other sites
A lot of email verification systems use an authentication token. It's generated randomly and then a link is sent in the email. The user follows the link which gives a script the authentication token, the script then checks whether the token is associated with anyone in the database in which case it validates the user. That way, if someone enters an undeliverable address, they will never receive the email and so will be unable to validate their account. Then whenever they try to access the site they're prompted for either the activation code or a correct email address.

Share this post


Link to post
Share on other sites
I understand that.. and my site is set up that way.. but my point is where one would send out a email to them at a later time.. AFTER they verified their email though this process.. Peoples emails do over time become invalid, and if I get a bounce back on a member that has closed an email account, I want to be able to flag their account to update the system with a new email...


[!--quoteo(post=385146:date=Jun 17 2006, 07:23 PM:name=Fyorl)--][div class=\'quotetop\']QUOTE(Fyorl @ Jun 17 2006, 07:23 PM) [snapback]385146[/snapback][/div][div class=\'quotemain\'][!--quotec--]
A lot of email verification systems use an authentication token. It's generated randomly and then a link is sent in the email. The user follows the link which gives a script the authentication token, the script then checks whether the token is associated with anyone in the database in which case it validates the user. That way, if someone enters an undeliverable address, they will never receive the email and so will be unable to validate their account. Then whenever they try to access the site they're prompted for either the activation code or a correct email address.
[/quote]

Share this post


Link to post
Share on other sites
Surely if that were the case they would have become inactive and therefore not bothered to change their email address. If that's the case then checks for last login times would solve that problem.

Share this post


Link to post
Share on other sites
I found this:

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]stevenlim at Edinburgh-Consulting dot com
06-Sep-2002 01:53
How to detect a bounce email

1. make sure the email you send out have the header
"Return-Path: detect-bounce@yourdomain.com\r\n",
&
"Return-Receipt-To: bounce@yourdomain.com\r\n"

2. setup this detect-bounce mail account at your mail server

3. redirect the incoming mail from this email account to your php script (check your mail server doc on how do this)

4. your php script will then be able to process the incoming email in whatever way you like, including to detect bounce mail message (use regexp search).

Note that the mail will be not be store after the mail server has redirect to your script. If you want to store it, you need additional code in your script

Hope the above help

Steven Lim
IT Consultant (www.Edinburgh-Consulting.com)
11-Apr-2002 09:35 [/quote]

-can't tell you more than that

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.