Hi Thanks for taking interst this is my script
<?
//check for new messages
$mailbox = imap_open("{mail.mydomain.com/pop3:110}INBOX",
"user@mydomain.com","123");
$check = imap_check($mailbox);
$total = $check->Nmsgs;
imap_close($mailbox);
for($i=1; $i<=$total; $i++)
{
$mailbox = imap_open("{mydomain.com/pop3:110}INBOX",
"user@mydomain.com","123");
$header = imap_header($mailbox, $i);
$msg = $header->Date."-----";
$to2 = $header->to;
$to = $to2[0]->mailbox."@".$to2[0]->host;
$msg .= $to."-----";
$from2 = $header->from;
$from = $from2[0]->mailbox."@".$from2[0]->host;
$msg .= $from."-----";
$cc2 = $header->cc;
$cc = $cc2[0]->mailbox."@".$cc2[0]->host;
$msg .= $cc."-----";
$msg .= $header->ReplyTo."-----";
$msg .= $header->Subject."-----";
$body = imap_body($mailbox,$i);
imap_close($mailbox);
print "head=$msg&body=$body";
}
?>