Advertisement
| 10.13.2008 at 03:36PM PDT, ID: 23811146 | Points: 500 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: |
<?php
$mail = imap_open ("{localhost:995/pop3/ssl/novalidate-cert}INBOX", "myMailBox", "myPassword");
print_r(imap_errors());
$headers = imap_headers($mail);
$last = imap_num_msg($mail);
$header = imap_header($mail,$last);
for ($counter = 0; $counter <= $last; $counter++)
{
$info = imap_fetchstructure($mail, $last);
$numparts = count($info->parts);
$i=0;
if ($numparts >1)
{
foreach ($info->parts as $part)
{
if ($part->disposition == "attachment")
{
$i++;
echo $i." Attachment/s found!\n\n";
echo "\t C:\\out\\" . $part->dparameters[0]->value . "\n";
imap_savebody ($mail , "c:\\out\\" . $part->dparameters[0]->value , $counter, $i);
exit();
}
}
}
}
imap_close($mail);
?>
|
Advertisement