1

I've special e-mail accounts on my web server (@mydomain.com). I want to run a php script automatically when one of these accounts get a new e-mail. For example: when info@mydomain.com address receives a mail, I want to run "receivedMail.php" file and read this new e-mail. I don't know where I will start or how can I do this. I have cpanel and I can buy a new software if I need or can I make this with php?

onivi
  • 1,326
  • 3
  • 17
  • 25
  • possible duplicate of [PHP notification when i receive new e-mail](http://stackoverflow.com/questions/1956549/php-notification-when-i-receive-new-e-mail) – Boann Oct 28 '13 at 05:35
  • duplicates: http://stackoverflow.com/questions/17861126/what-is-the-simplest-way-to-run-a-script-when-an-email-is-received http://stackoverflow.com/questions/2270013/call-a-php-script-whenever-an-e-mail-is-received –  Oct 28 '13 at 05:35
  • use cron jobs..http://stackoverflow.com/questions/4421020/use-php-to-create-edit-and-delete-crontab-jobs – Deepu Oct 28 '13 at 05:35

2 Answers2

3

You need to tell cpanel to call your PHP script whenever it receives email on that account. This link may help: http://www.phpshare.org/articles/Piping-Incoming-Mail-with-PHP

elixenide
  • 42,388
  • 14
  • 70
  • 93
1

This service is offered by some email providers like mailgun.

check routes/actions on http://documentation.mailgun.com/api-routes.html#actions

Shahram
  • 35
  • 5