class.POP3Mail : Introduction Text to POP3Mail class
Author : Sumit Gupta
Recent I need to wrote a script to fetch and handle emails by connecting to Mail server using pop3 protocol.
Alhough there are bulk of such software available, but I opt to try my understanding with POP3 protocol. First I search internet for such script and found a small code for the job.
But that script is not quite good to work with. More over its just a collection of functions. So, I wrote a wrapper class for that script.
Use of this script is quite simple. Infact my test script ends up with 4 line in it. This test script connect to given mail server, and fetch no. of emails in an Inbox:
Order of call to function is quite simple. first Make a object instance of class. Now connect to mail server, Perform some task such as Delete(), getStat(), MailCount(),getRefinedUID() etc. At last don't forget to disconnect to server. Though PHP close the network connection, but
it will not close your inbox on mail server, that result in block of mail box for sometime depending on your mail server setting. So, you have to make sure in all case your close your Connection manually.
Though its very basic script and not properly documented from my end, but please feel free to ask me about it and/or any update to the script (like Error handling etc. which this script needs).
Download class.POP3Mail.php (Mailing class in PHP)