News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPBuilder.com:
Downloading and Parsing Gmail Messages in PHP
September 01, 2010 @ 09:21:04

New on PHPBuilder.com today there's a tutorial showing you how to download and parse messages from Google Mail. In their case it's grabbing and parsing submissions from a form.

Some friends of mine publish a literary journal that accepts submissions via email. At their request I wrote a script to download messages from the journal's Gmail account and do some simple parsing tasks. Most of the submissions are made using an HTML form and a corresponding mailer script on their website, so I knew the precise format of the incoming messages (see Figure 1). What I didn't know was how to access Gmail in PHP.

He tried out the libgmailer script first, but ran into roadblocks until he realized he could use something PHP already had - the imap functions. With these he shows how to make a connection to the Gmail servers, get the listing of messages and pull out the body for the one you want to parse.

1 comment voice your opinion now!
gmail google mail parse imap tutorial


blog comments powered by Disqus

Similar Posts

ThinkPHP Blog: Methods to Reduce the Load of Your Webserver by Caching Content

PHP-Tip-a-Day: PHP Tutorial: The Allegory of The Factory Pattern

Chris Hartjes' Blog: Building a Gimmebar Sidebar

Ryan Gantt's Blog: Horizontal reusability with traits in PHP 5.4

PHPEveryDay.com: New Tutorials Posted (WDDX in PHP)


Community Events

Don't see your event here?
Let us know!


language example laravel api unittest introduction security opinion extension podcast laravel5 version php7 framework community library release series interview voicesoftheelephpant

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework