Reputation: 1021
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.
Upvotes: 0
Views: 2325
Reputation: 4810
Why not pipe the emails instead of using imap_open()
? This would allow you to access the email immediately as it comes in, and then decide if you even want it stored in the inbox.
Upvotes: 0
Reputation: 4916
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.
Upvotes: 0