Reputation: 20049
Ok..... basically what I'm trying to do is setup something that will handle all incoming mail on a certain POP3 email address, pass all the relevant data to a PHP script, which will then parse the data & insert it into a MySQL database.
Now I have been looking around a bit..... checked out procmail, but that just confused the hell outta me (I'm not much of a server guy, just know enough CL stuff to get by), so was wondering if there were any better options available to me or any existing PHP classes that made it a bit easier?
Thanks a lot - any help would be much appreciated!
Upvotes: 1
Views: 4752
Reputation: 5147
Sounds like you have two tasks before you:
Write a PHP script that checks the POP3 account, processing any mail it finds.--You could use PHP's IMAP functionality, which supports IMAP, POP3 and NNTP.
Somehow get the above-mentioned script to run when new mail is received.--An easy way to simulate this effect would be to use a cron task to run your script regularly...perhaps every few minutes. Hopefully, your web host supports cron tasks--you may find an option to set them up in your hosting account's control panel or you may need to contact support for assistance.
Hope this helps,
Ben
Upvotes: 2
Reputation: 2472
There are some classes built to help you out as well:
http://www.phpclasses.org/package/2-PHP-Access-to-e-mail-mailboxes-using-the-POP3-protocol.html
Upvotes: 2