PeggyBuckham Posted January 4, 2012 Share Posted January 4, 2012 I have a form where the user puts in a email address. My client whats to make sure that the emails are valid emails. So after validating the format and the domain. I will send a email to the user. I want to check to see if this email bounces or not. I think that if I add $headers .= "Return-Path: [email protected]\r\n"; to the header of the email then if it bounces an email will be sent to [email protected]. There could end up being at least 50 bounces. Is this the correct way to do this?? I have never used a Return-Path in the $headers before. It would be nice if I could put the email address that bounce into the database that the infor collected from the form goes. Quote Link to comment https://forums.phpfreaks.com/topic/254360-checking-bounces-from-mail-function/ Share on other sites More sharing options...
PeggyBuckham Posted January 5, 2012 Author Share Posted January 5, 2012 I'm hoping someone has an answer for me becouse this is not working...yet... All I really need is to be able to get the emails that bounce to go to a specific email address. I would appreciate any help I can get. Thanks Here is my code: <?php $to = $email; $subject = "Confirmation Email"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From:[email protected]'. "\r\n"; $headers .= 'Return-Path: [email protected]'. "\r\n"; $return_path = '[email protected]'; $message ='<html> <head> </head> <body> <table> <tr> <td> <p>my text</p> <img src="http://www.example.com/enews/images/photo.jpg" width="600" height="437" /> </body> </html>'; mail($to, $subject, $message, $headers, '-f ' . $return_path); ?> Quote Link to comment https://forums.phpfreaks.com/topic/254360-checking-bounces-from-mail-function/#findComment-1304615 Share on other sites More sharing options...
PeggyBuckham Posted January 5, 2012 Author Share Posted January 5, 2012 My Bad. I was just too impatient. The code above works! Quote Link to comment https://forums.phpfreaks.com/topic/254360-checking-bounces-from-mail-function/#findComment-1304619 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.