PHP + email

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • E.T. Grey

    PHP + email

    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

    #2
    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.p hp"

    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

    Comment

    • Carl Vondrick

      #3
      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
      Professor of Computer Science at Columbia University, researching computer vision, machine learning, and AI applications.

      Comment

      Working...