PHP Classes

pop3-stream: Stream wrapper to access POP3 messages (old)

Recommend this page to a friend!
  Info   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStar 25%Total: 2,920 All time: 1,282 This week: 560Up
Version License PHP version Categories
pop3-stream 1.2Free for non-comm...5.0Email, PHP 5, Stream wrappers
Description 

Author

This class implements a POP3 stream handler that can be used to access messages in mailboxes using POP3 (or secure POP3, as of v1.2) as if they were regular files.

It accesses a given POP3 mailbox using the PHP IMAP extension authenticating as an user with password specified in the URL passed to the PHP fopen function.

The class can read individual message headers and body in a single stream when the PHP fread function is called.

It can also list all the messages in the mailbox when the PHP readdir function is called.

The class can retrieve details of a message using the PHP function stat or delete a message with the PHP unlink function.

Please note that this wrapper has issues handling deletion of emails. It is recommended that you use Manuel Lemos' wrapper instead.

Innovation Award
PHP Programming Innovation award winner
January 2008
Winner
POP3 is a popular Internet protocol used to retrieve messages sent to a mailbox.

It is necessary to understand the POP3 protocol to send commands and interpret responses in order to retrieve the list of messages in a mailbox and retrieve the message contents.

This class greatly simplifies that task by acting as a stream wrapper. It lets PHP applications list POP3 mailboxes as if they were directories and retrieve messages as if they were files.

Manuel Lemos
Picture of Rick Hodger
Name: Rick Hodger <contact>
Classes: 3 packages by
Country: United Kingdom
Age: 44
All time rank: 65334 in United Kingdom
Week rank: 180 Up5 in United Kingdom Up
Innovation award
Innovation award
Nominee: 2x

Winner: 1x

Details

Due to the constraints of the stream wrapper system in PHP, each time you attempt to read an email with this class, a seperate connection will be made to the POP3 server, and a fresh login performed. Using the opendir() commands will cause it to connect once, retreive the list of mail, and then disconnect. This is to avoid causing problems on POP3 servers that only allow a single login, or "lock" the mailbox. Because of this, it is not recommended to use this stream wrapper/class as a basis for a webmail system. It will be fairly slow. It is however ideal for translating emails into other systems, such as an email-to-RSS application, email-to-Blog and so on.

Screenshots (1)  
  • pop3-screenshot.png
  Files folder image Files (7)  
File Role Description
Plain text file pop3.stream.php Class File wrapper include
Plain text file example1.php Example Example #1 - Read an email
Plain text file example2.php Example Example #2 - Listing the contents of a POP3 account
Plain text file example3.php Example Gmail example using secure POP3
Plain text file exportpop3.php Example Example application - Downloads emails as text files to a folder.
Plain text file README.TXT Doc. Important information

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:2,920
This week:0
All time:1,282
This week:560Up
User Ratings User Comments (1)
 All time
Utility:25%StarStar
Consistency:41%StarStarStar
Documentation:50%StarStarStar
Examples:41%StarStarStar
Tests:-
Videos:-
Overall:25%StarStar
Rank:4415