homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
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

 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?




 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.


 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.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved