Hi, maybe mine it's a bit a simple question; I would like to instruct my server to receive mails and to parse them via a php script. How can I do it?
Thanks
Hi, maybe mine it's a bit a simple question; I would like to instruct my server to receive mails and to parse them via a php script. How can I do it?
Thanks
Email is going to be sent to an email address that you chose. The email will be stored on either a POP3 or IMAP server and you will have to periodically poll the server to check for new messages. If new messages are detected, your app will then have to download and parse them, and then delete the message from the server.
There are a handful of classes / code snippets out there that will do most of the heavy lifting for you. (like this example). You'll probably want to configure the script to be executed via a cron job so it runs every 5 minutes or-so.
As a side note though, using PHP for this application is rather inelegant. PHP is designed to render HTML and interact with a user. Using a more general purpose language like Python or Perl would be a better solution.