Re: Can a PHP program recieve an e-mail and write it to a file???
| From: | Ignacio Vazquez-Abrams | Date: | Thu, 18 Jan 2001 20:20:24 +0000 |
| Subject: | Re: Can a PHP program recieve an e-mail and write it to a file??? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-35428@lists.php.net to get a copy of this message | ||
On Thu, 18 Jan 2001, Jeremy Bowen wrote:
> Hey,
>
> Here is what I need to do, I need to have a PHP script recieve an e-mail and
> write it to a file after erasing whatever was in the file before.
>
> I suppose that it should have some sort of authentication built in to prevent
> people from e-mailing PHP code that could be processed and do bad things.
>
> Is there any way to do this? Can a PHP script recieve and e-mail?
>
> Could the e-mail be written to a mail queue say php-email-processor@domain.com
> and the script periodically check the mail queue for new e-mail print its
> contents to a text file somewhere in the serverroot and then erase the mail
> queue???
>
> Does this sound possibile???
>
> Thanks,
>
> Jeremy
>
If you're using sendmail, you can set up an alias to execute a program and
send the message to the program's standard input whenever the message is sent
to an arbitrary address.
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>