Executing POP3 Commands with a Webbot

POP3 commands can be performed with PHP's opensocket(), fputs(), and fgets() functions. The LIB_pop3 library is available for you to download from this book's website. This library contains functions for connecting to the mail server, authenticating your account on the server, finding out what mail is available for the account, requesting messages from the server, and deleting messages.

The scripts in Listings 15-10 through 15-13 show how to use the LIB_pop3 library. The larger script is split up and annotated here for clarity, but it is available in its entirety on this book's website.

Note

Before you use the script in Listing 15-10, replace the values for SERVER, USER, and PASS with your email account information. ...

Get Webbots, Spiders, and Screen Scrapers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.