Sorry for my english....
for read the attachment's:
<?
foreach ($_GET as $k => $v)
{
$$k = $v;
}
$login = 'mylogin';
$password = 'mypassword';
$host = '{myhost:110/pop3}';
$mbox = imap_open("$host", "$login", "$password");
$struckture = imap_fetchstructure($mbox, $id);
$message = imap_fetchbody($mbox,$id,$part);
$name = $struckture->parts[$part]->dparameters[0]->value;
$type = $struckture->parts[$part]->typee;
############## type
if ($type == 0)
{
$type = "text/";
}
elseif ($type == 1)
{
$type = "multipart/";
}
elseif ($type == 2)
{
$type = "message/";
}
elseif ($type == 3)
{
$type = "application/";
}
elseif ($type == 4)
{
$type = "audio/";
}
elseif ($type == 5)
{
$type = "image/";
}
elseif ($type == 6)
{
$type = "video";
}
elseif($type == 7)
{
$type = "other/";
}
$type .= $struckture->parts[$part]->subtypee;
######## Type end
header("Content-typee: ".$type);
header("Content-Disposition: attachment; filename=".$name);
######## coding
$coding = $struckture->parts[$part]->encoding;
if ($coding == 0)
{
$message = imap_7bit($message);
}
elseif ($coding == 1)
{
$wiadomsoc = imap_8bit($message);
}
elseif ($coding == 2)
{
$message = imap_binary($message);
}
elseif ($coding == 3)
{
$message = imap_base64($message);
}
elseif ($coding == 4)
{
$message = quoted_printable($message);
}
elseif ($coding == 5)
{
$message = $message;
}
echo $message;
########## coding end
imap_close($mbox);
?>