Re: Update site through email

From: Date: Thu, 29 Jun 2006 21:10:19 +0000
Subject: Re: Update site through email
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-238930@lists.php.net to get a copy of this message
Manuel Lemos wrote:
Hello, on 06/29/2006 10:54 AM Rodrigo de Oliveira Costa said the following:
Hy guys I'd like to know if there is a way to update a site through sending an email. Something like this, you send an email and the body of the email substitutes a text you use in your site. Igreat apreciate any help since I couldn't find anything on this topic.
Sure, you can send a message attaching the files you want to update in your site to an address with a POP3 mailbox and then use a POP3 client to retrieve and parse the message to extract the files to be updated. You may want to try this POP3 client class that you can use for that purpose. It provides a cool feature that lets you retrieve messages from POP3 mailbox using PHP fopen or file_get_contents functions like this: file_get_contents('pop3://user:password@pop3.myserver.com/1'); http://www.phpclasses.org/pop3class You can also use this message parser class that lets you process your messages and extract any files easily. http://www.phpclasses.org/mimeparser Take a look at this example that demonstrates how to integrate both classes easily to parse your message structure: http://www.phpclasses.org/browse/file/14695.html
I've had to have a perl script reacting to emails and acting on them. I did it using RetchMail (http://open.nit.ca/wiki/?page=RetchMail), which is mindnumbingly fast when you need to download a bunch of emails. As the page says, stupidly fast. As a disclaimer, it's an opensource app maintained by people at my workplace. Still, it's probably the fastest POP3 mail fetcher out there. Regards, Adam Zey.

« previous php.general (#238930) next »