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 Example 14-10 through Example 14-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 Example 14-10, replace the values for SERVER, USER, and PASS with your email account ...

Get Webbots, Spiders, and Screen Scrapers, 2nd Edition 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.