homepage Welcome to WebmasterWorld Guest from 54.196.69.189
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Stripping content of an email
Pico_Train




msg:4307836
 2:08 pm on May 4, 2011 (gmt 0)

Hi there,

Say I setup an email address to receive specific emails.

What would I have to do to get php to read the contents of the email, strip certain parts in a certain way and return them to a function to insert each part appropriately into a db.

I don't really even know where to start on this one but I reckon I will need a cron job and curl possibly.

Anyone have any experience with this?

Thanks!

 

rocknbil




msg:4307887
 4:30 pm on May 4, 2011 (gmt 0)

Mmm, since you're talking about a mail function you'd have to parse out mailbox queues, not something I've done a lot of (and a long time ago.) Basically whatever system you use (let's say, sendmail) you'd have to figure out where the mail is stored and build an app to parse out the mailbox. Lots of command line stuff and permissions issues to deal with, as I recall.

TheMadScientist




msg:4309308
 3:54 pm on May 7, 2011 (gmt 0)

What rocknbil said, with a twist:

If you use cPanel you can select the Forward > Pipe to Program option and send the incoming mail to a PHP executable.

If you don't you will need to adjust you mail software like rockinbil said, but again, you can run them through a PHP executable. I don't know what software you use, but with cPanel it's simple to get it to the program and with Postfix it's a bit more complicated but nothing too super, extra ugly. (Of course how 'ugly' depends on your definition of 'ugly to code' ... lol)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved