Connecting Tech Pros Worldwide Forums | Help | Site Map

PHP + email

E.T. Grey
Guest
 
Posts: n/a
#1: Jan 31 '06
Is it possible to have a PHP script receive an email (CSV text). The
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 ?

TIA


Gordon Burditt
Guest
 
Posts: n/a
#2: Jan 31 '06

re: PHP + email


>Is it possible to have a PHP script receive an email (CSV text). The[color=blue]
>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 ?[/color]

The closest arrangement I know of that does this:

Run a SMTP server locally such as sendmail or exim that supports
".forward" files.

Install a ".forward" file that pipes the email into a
STANDALONE (command-line) php script (no web server involved).
E.g.
"|/usr/local/bin/emailreceiver.php"

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,
etc.).

Gordon L. Burditt
Carl Vondrick
Guest
 
Posts: n/a
#3: Jan 31 '06

re: PHP + email


E.T. Grey wrote:[color=blue]
> Is it possible to have a PHP script receive an email (CSV text). The
> 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 ?
>
> TIA
>[/color]
Yes, you can use this extension: http://us3.php.net/imap

--


Carl Vondrick
usenet@carlsoft.net
www.carlsoft.net
Closed Thread