As a matter of fact I did, here's some code for you:
$mbox = imap_open("{pop.mailserver.com:110/pop3}INBOX", "username", "password");
foreach (imap_headers($mbox) AS $key => $value) {
$msgnr = eregi("N (.*)) ", $value, $rAr);
$header = imap_headerinfo($mbox, $rAr[1]);
$subject = $header->subject;
$body = get_part($mbox, $rAr[1], "TEXT/PLAIN");
$data = get_part($mbox, $rAr[1], "IMAGE/JPEG");
if ($data) $type = ".jpg";
if (!$data) {
$data = get_part($mbox, $rAr[1], "IMAGE/PJPEG");
if ($data) $type = ".jpg";
}
if (!$data) {
$data = get_part($mbox, $rAr[1], "IMAGE/GIF");
if ($data) $type = ".gif";
}
# Save the image
$filename = "/tmp/" . rand(10000, 99999) . $type;
$fil = fopen($filename, "w");
fwrite($fil, $data);
fclose($fil);
imap_delete($mbox, $rAr[1]);
}
imap_expunge($mbox);
As you may see, this loops through the mailbox, and for each iteration takes the subject into $subject, body into $body and then looks for an attachment of JPG or GIF and then saves that attachment to the /tmp folder - you can do what you want there instead of course. Then it marks the message for deletion, and after the whole looping is done it expunges the messages.
Good luck!