/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php // include class include("Net/POP3.php"); // initialize object $pop3 = new Net_POP3(); // attempt connection to server if (!$pop3->connect("example.com", 110)) { } // attempt login $ret = $pop3->login("john", "doe"); } // print number of messages found echo $pop3->numMsg() . " message(s) in mailbox\n"; // print message headers if ($pop3->numMsg() > 0) { for ($x=1; $x<=$pop3->numMsg(); $x++) { $hdrs = $pop3->getParsedHeaders($x); echo $hdrs['From'] . "\n" . $hdrs['Subject'] . "\n\n"; } } // disconnect from server $pop3->disconnect(); ?>
URL: http://www.melonfire.com/community/columns/trog/print.php?id=275