JasonORDSW Posted May 26, 2006 Share Posted May 26, 2006 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 Link to comment https://forums.phpfreaks.com/topic/10483-detecting-bounced-emails/ Share on other sites More sharing options...
JasonORDSW Posted June 17, 2006 Author Share Posted June 17, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/10483-detecting-bounced-emails/#findComment-46711 Share on other sites More sharing options...
klaroen Posted June 17, 2006 Share Posted June 17, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/10483-detecting-bounced-emails/#findComment-46785 Share on other sites More sharing options...
kenrbnsn Posted June 17, 2006 Share Posted June 17, 2006 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. [/quoteWhat 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 Quote Link to comment https://forums.phpfreaks.com/topic/10483-detecting-bounced-emails/#findComment-46793 Share on other sites More sharing options...
Fyorl Posted June 17, 2006 Share Posted June 17, 2006 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 Link to comment https://forums.phpfreaks.com/topic/10483-detecting-bounced-emails/#findComment-46833 Share on other sites More sharing options...
JasonORDSW Posted June 18, 2006 Author Share Posted June 18, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/10483-detecting-bounced-emails/#findComment-46855 Share on other sites More sharing options...
Fyorl Posted June 18, 2006 Share Posted June 18, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/10483-detecting-bounced-emails/#findComment-46856 Share on other sites More sharing options...
mainewoods Posted June 18, 2006 Share Posted June 18, 2006 I found this:[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]stevenlim at Edinburgh-Consulting dot com06-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 server3. 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 scriptHope the above helpSteven LimIT Consultant (www.Edinburgh-Consulting.com) 11-Apr-2002 09:35 [/quote]-can't tell you more than that Quote Link to comment https://forums.phpfreaks.com/topic/10483-detecting-bounced-emails/#findComment-47027 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.