Code Comments
Programming Forum and web based access to our favorite programming groups.i have a problem to read mail message form smtp server
i have write this code:
<?
echo "pp";
$mbox = imap_open("{pop.191.it}INBOX","prova@example.com","PASSWORD");
if(!$mbox){
echo "merdaccia";
exit;
}
$check = imap_mailboxmsginfo($mbox);
if ($check) {
echo "Date: " . $check->Date . "<br />\n" ;
echo "Driver: " . $check->Driver . "<br />\n" ;
echo "Mailbox: " . $check->Mailbox . "<br />\n" ;
echo $msg['num'] = $check->Nmsgs;
echo "Recent: " . $check->Recent . "<br />\n" ;
echo "Unread: " . $check->Unread . "<br />\n" ;
echo "Deleted: " . $check->Deleted . "<br />\n" ;
echo "Size: " . $check->Size . "<br />\n" ;
} else {
echo "imap_check() failed: " . imap_last_error() . "<br />\n";
}
echo "<pre>";
/*
for($i=1; $i<$msg['num']+1; $i++){
echo imap_fetchheader($mbox, $i);
echo "body:<br>";
$body = imap_fetchstructure($mbox,$i);
var_dump($body);
echo "<hr>";
}
echo "</pre>";
*/
$mnum = 1;
echo $nummessages = imap_num_msg($mbox);
echo $body = imap_fetchbody($mbox, $mnum, 2);
var_dump($body);
echo "<hr>";
$struct = imap_fetchstructure($mbox, $mnum);
var_dump($struct);
$parti = $struct->parts;
$bo = count($parti);
echo "<hr>";
for($i=0; $i<$bo; $i++){
//switch(
$read_part = $struct->parts[$i];
var_dump($read_part);
}
// $strFileName = $att[$file]->parameters[0]->value;
// $strFileType = strrev(substr(strrev($strFileName),0,4))
;
// $fileContent = imap_fetchbody($mbox,$id,$file+2);
// echo $thefile = imap_base64($fileContent);
//$struct = imap_fetchstructure($mbox, $mnum);
//$vv = buildparts($mbox, $mnum, $struct);
imap_close($mbox);
?>
exist an good source code for read smtp mail or functionaly example
(i not use pear)
trancks
Post Follow-up to this messageHello, on 12/27/2004 02:14 PM Red Owl said the following: > exist an good source code for read smtp mail or functionaly example > (i not use pear) I think you mean reading messages from a POP3 server. In that case you may want to try this POP3 client class that lets you retrieve messages in a mailbox accessible via POP3 protocol. http://www.phpclasses.org/pop3class -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.