Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

Automatic acknowledge of wrong email return

the mail() function

Moderators: macek, egami, gesf

Automatic acknowledge of wrong email return

Postby Gian_Piero » Wed Oct 06, 2004 8:25 am

Hi !
I have been learning how to use the email() function.
It does work always fine.
When the contact email address I sent is wrong, I get the notice of wrong email address in my inbox list.
Now, I would like to know how to get this information of wrong email return in my php coding, so that I get immediate notice, without waiting for the next time I go check my inbox.
I should very much appreciate any help !
New php-forum User
New php-forum User
Posts: 22
Joined: Wed Oct 06, 2004 8:12 am
Location: Surfside,Florida

Postby swirlee » Wed Oct 06, 2004 8:29 am

Well, there's no way to do this "immediately" since the failed delivery notification can take anywhere from 5 seconds to a week to occur. The way in PHP to do this would be to make PHP check your mailbox for notifications when you run the script. PHP has some built-in POP3 functions that you could use to do this, or there are a number of libraries (PEAR an otherwise) that you could use as well.
User avatar
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby Gian_Piero » Thu Oct 14, 2004 7:52 am

Thank you for your reply.
I searched for detection of rejected email and return to my inbox.
I found on "how to detect a bounce mail".
Is it what I am looking for ? In other words is a "bounce mail" defined as a returning email because it could not be found ?
If it is, it seems as a setup at my mail server is needed, I thought my host could do it but they claim this being development help which they do not provide.
I enclose a copy of the procedure as it is in the

How to detect a bounce email

1. make sure the email you send out have the header

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 (

Well, how can I proceed ?
Thanks for the help
New php-forum User
New php-forum User
Posts: 22
Joined: Wed Oct 06, 2004 8:12 am
Location: Surfside,Florida

Return to PHP coding => Mail

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.