Process pop3 mails with php
Have you ever wanted to automate something that comes in via email, such as domain renewals, payment notifications etc? Well, I will give you the basics how to do it.
Please note: Due to contractual obligations, I cannot divulge much information here that I have written for the company, however the gist of it will be displayed.
First, you will need to get hold of this phpclass package. For purposes of my script, I changed the class a bit to read the following;
Line 526
From
$strPathToFile = $strPathToDir . $intMsgNum . $strFileEnding;
To
$strPathToFile = $strPathToDir . $intMsgNum . date('Y-m-d h-i-s') . $strFileEnding;
This is to allow a failsafe measure for my coding implementation.
Then, you will need to get this class, from there you can build your own library to process the emails that you have retrieved in the above class.
What I did was downloaded all the emails to a folder then created a loop reading all those emails and individually processing each one, I put in logic to email on certain events for my sanity and I always log my errors to a mysql table for reference and easy debugging.
If you want some help on this, or just need to know how I have done it (without breaking contractual obligations), contact me and I will assist you.

