Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- E.T. Grey
January 31, 2006, 1:20 am
rate this thread
problem is this, I want a server to send me an email, and then I want to
be able to have a PHP script 'listening' for email and then processing
the data in the email.
Is it possible to have a PHP script 'listening' or responding to an
'email received' event, so that it can process the data ?
Re: PHP + email
The closest arrangement I know of that does this:
Run a SMTP server locally such as sendmail or exim that supports
Install a ".forward" file that pipes the email into a
STANDALONE (command-line) php script (no web server involved).
The PHP script gets invoked with the email on stdin when an email
arrives. It is the responsibility of the script to skip over or
deal with the headers, and to filter out Viagra ads and bank phishing
spoofs that are not in the proper format for the data, and not to
open up security holes. The script also has to deal with the
possibility that it might be invoked multiple times concurrently
if multiple emails arrive at the same time (so use database locking,
Gordon L. Burditt