Q:

How can I process incoming email messages with PHP?

I want to process incoming emails to an address and insert them into a mysql database. I am using a grid-service media temple host with SHH access but I have no idea where to start. I also want to store attachments or copy them to a directory on my host and save the url in the database.

A:

The simplest way to process incoming mail in PHP is imap_open(), which you can use to open a mailbox, either using IMAP4 or POP3.
You would need to run your script periodically, or at least regularly run imap_ping() to 'poll' for new messages.

