Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

smtp read mail from server and download in apache
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



Report this thread to moderator Post Follow-up to this message
Old Post
Red Owl
12-27-04 08:55 PM


Re: smtp read mail from server and download in apache
Hello,

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

Report this thread to moderator Post Follow-up to this message
Old Post
Manuel Lemos
12-27-04 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:37 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.