Re: how to trigger incomming mail

From: Date: Fri, 19 Jan 2001 18:06:48 +0000
Subject: Re: how to trigger incomming mail
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-35673@lists.php.net to get a copy of this message
> on this mail I want to trigger mail incomming on this adres so I can start a > php script that filters this standaard mail getting the order code and put Ideally you've got PHP compiled as a CGI as well as a Module. The trigger part is in your procmail filters, which I've never done, so I can't help much, except to say "man procmail" Conceptually, though, the rest is fairly easy: Something you put in your .procmail file will look more or less like this: blahblahblah "/full/path/to/your/script.php XXX" Where blahblahblah is how procmail identifies which emails to send and XXX is procmail's secret code for "shove the actual email in here" Then your script just looks like: #!/full/path/to/cgi/binary/php -q <?php $email = $arg[0]; #parse your email here and do your database stuff to it ?> You'll need to chmod your script to be executable by the process running procmail, and you'll have to make sure it has Un*x newlines, not Windows, because that #! line has to have a Un*x newline at the end. By Day: |By Night: Don't miss the Zend Web Store's | There's not enough room here... Grand Opening on January 23, 2001! | Start here: http://www.zend.com | http://l-i-e.com/artists.htm

« previous php.general (#35673) next »