Hi dupa,
I've used the imap functions. I followed examples in the PHP manual. E.g. I've used this code to detect a certain message based on From: and Subject:
$mbox = imap_open ("{pop3.your.provider.com:110/pop3}INBOX", "username", "password");
$total = imap_num_msg($mbox); # get the number of messages sitting in the mailbox
for ($x=$total; $x>0; $x--) {
$headers = imap_header ($mbox, $x);
$from = htmlspecialchars($headers->fromaddress);
$subject=htmlspecialchars($headers->subject);
echo "Subject: $subject<br>From: $from<br>"; #just for debugging
if (!(strpos($from, "address.to.recognize@provider.com")===FALSE)) {
if (!(strpos($subject, "subject to be recognized")===FALSE)) {
echo "Message detected<br>"; #just for debugging
$body=imap_body($mbox, $x);
/* code for parsing the message */
}
}
}
This works very good.
The other possibility may be to open a connection to the POP server via
$fp = fsockopen ('pop3.your.provider.com', 110, $errno, $errstr, 30);
and to try communicating with it on that level, i.e. sending commands like USER, PASS, LIST, TOP, RETR, DELE ... but I haven't tried that
Hope it helps.