ben_b Posted October 5, 2006 Share Posted October 5, 2006 I have a php script that sends out emails using the mail() function and for some reason if the email address is incorrect it doesn't send a bounce message to the reply address even though it's set correctly in the headers. Any ideas on how I can fix this? Quote Link to comment Share on other sites More sharing options...
Hi I Am Timbo Posted October 5, 2006 Share Posted October 5, 2006 Send the bounce message yourself. It probably doesn't bounce becuase it never gets sent.[code]<?phpif(!mail('asdf@asdf.com', 'Subject', 'Message')){ mail('me@com.com', 'Message: Subject did not go through', 'Error Sending Message: Subject With contents: \nMessage');}?>[/code] Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted October 5, 2006 Share Posted October 5, 2006 There are a few things to consider - minor but FYI worth remeberign for the future...If this is a case where you want to ensure that the email address provided by a user is valid then check this out [url=http://www.zend.com/zend/spotlight/ev12apr.php#Heading11]http://www.zend.com/zend/spotlight/ev12apr.php#Heading11[/url] a brilliant method to use during the sigin up process (IMO of course).Now notwithstanding that I like the above method - its not infallable - the script that actually asks the server if an email address would be accepted does not mean to say that email address exists - they may have a catch all enabled on the domain.The other point to note is that checking the true/false status of the mail function, if the inbox may simply be full - the email is valid but it will/may be bumped back - making you think that its an invalid address. You could delete an address that is perfectly OK. Quote Link to comment 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.