tags:

views:

1309

answers:

2

I am doing a bounce-email handling with php. I have include the return path in the mail function, e.g:

mail($to_address, $subject, $message, $headers, "-f".$return_path );

$return_path = "[email protected]";

Now, what should my php script looks like (and where should i put it) in order to read all the bounce emails? (can show me with some sample code?)

+2  A: 

You'll need to configure whichever mail transport agent handles (MTA) "[email protected]" to send the mail to the PHP script that does whatever magic you need it to do. The MTA is what actually handles mail coming into the server. There are many different MTA's, but most of them have some configuration where you can basically tell it to pipe email coming into a certain address into a custom script.

Alternatively, you could setup a mailbox for your bounce handler and have PHP read it via POP3. For this, you'd have to configure an actual email account for your bounce handler. Then you have your PHP script connect to that mailbox using standard protocols. See the php.net documentation on IMAP/POP for how this is accomplished.

zacharydanger
Can you explore more on your second option? For the first option you mentioned, I am not quite understand, "mail transport agent", how and where to configure it??
is it something like this?$Count = login($login,$pass, $fp); where $login = "[email protected]";$pass = "password";$fp = connect ("mail.domain.com", $port = 110);
Just updated my answer. Hope it helps.
zacharydanger
Well, it does make clearer. I think i am getting there soon, I just found this http://www.weberdev.com/get_example-4015.html. Is it helpful?
A: 

Hi i am new bew in PHP can you have any Step or Scripts

Plz PM i waiting for your replay

Regards

Mani

www.webserverexpert.net

Mani