<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:series="http://unfoldingneurons.com/"
> <channel><title>Comments on: Retrieve Your Gmail Emails Using PHP and&#160;IMAP</title> <atom:link href="http://davidwalsh.name/gmail-php-imap/feed" rel="self" type="application/rss+xml" /><link>http://davidwalsh.name/gmail-php-imap</link> <description>Legendary scribbles about JavaScript, HTML5, AJAX, PHP, CSS, and ∞.</description> <lastBuildDate>Tue, 22 May 2012 16:21:46 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>By: WpFollow</title><link>http://davidwalsh.name/gmail-php-imap#comment-32299</link> <dc:creator>WpFollow</dc:creator> <pubDate>Mon, 21 May 2012 13:53:19 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=2351#comment-32299</guid> <description>jQuery(document).ready(function($){
var allPanels = jQuery(&#039;.body&#039;).hide();
jQuery(&#039;div.toggler&#039;).click(function() {
allPanels.slideUp();
jQuery(this).next().stop().slideToggle();
return false;
});
});</description> <content:encoded><![CDATA[<p>jQuery(document).ready(function($){</p><p> var allPanels = jQuery(&#8216;.body&#8217;).hide();</p><p> jQuery(&#8216;div.toggler&#8217;).click(function() {<br
/> allPanels.slideUp();<br
/> jQuery(this).next().stop().slideToggle();<br
/> return false;<br
/> });<br
/> });</p> ]]></content:encoded> </item> <item><title>By: asd</title><link>http://davidwalsh.name/gmail-php-imap#comment-32179</link> <dc:creator>asd</dc:creator> <pubDate>Mon, 14 May 2012 12:23:28 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=2351#comment-32179</guid> <description>&lt;code&gt;
/* output the email body */
$output.= ”.$message.”;}echo $output;
}/* close the connection */
imap_close($inbox);#######my full code####david walsh codewindow.addEvent(‘domready’,function() {
var togglers = $$(‘div.toggler’);
if(togglers.length) var gmail = new Fx.Accordion(togglers,$$(‘div.body’));
togglers.addEvent(‘click’,function() { this.addClass(‘read’).removeClass(‘unread’); });
//togglers[0].fireEvent(‘click’); //first one starts out read
});’;
$output.= ”.$overview[0]-&gt;subject.’ ‘;
$output.= ”.$overview[0]-&gt;from.”;
$output.= ‘on ‘.$overview[0]-&gt;date.”;
$output.= ”;/* output the email body */
$output.= ”.$message.”;}echo $output;
}/* close the connection */
imap_close($inbox);
&lt;/code&gt;</description> <content:encoded><![CDATA[<p><code><br
/> /* output the email body */<br
/> $output.= ”.$message.”;</p><p>}</p><p>echo $output;<br
/> }</p><p>/* close the connection */<br
/> imap_close($inbox);</p><p>#######my full code####</p><p>david walsh code</p><p>window.addEvent(‘domready’,function() {<br
/> var togglers = $$(‘div.toggler’);<br
/> if(togglers.length) var gmail = new Fx.Accordion(togglers,$$(‘div.body’));<br
/> togglers.addEvent(‘click’,function() { this.addClass(‘read’).removeClass(‘unread’); });<br
/> //togglers[0].fireEvent(‘click’); //first one starts out read<br
/> });</p><p>’;<br
/> $output.= ”.$overview[0]-&gt;subject.’ ‘;<br
/> $output.= ”.$overview[0]-&gt;from.”;<br
/> $output.= ‘on ‘.$overview[0]-&gt;date.”;<br
/> $output.= ”;</p><p>/* output the email body */<br
/> $output.= ”.$message.”;</p><p>}</p><p>echo $output;<br
/> }</p><p>/* close the connection */<br
/> imap_close($inbox);<br
/> </code></p> ]]></content:encoded> </item> <item><title>By: Sagar Ravkhande</title><link>http://davidwalsh.name/gmail-php-imap#comment-32062</link> <dc:creator>Sagar Ravkhande</dc:creator> <pubDate>Mon, 07 May 2012 19:29:47 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=2351#comment-32062</guid> <description>can any one give me code for the following program using IMAP-----&gt;
A GUI in which username and password along with the message content to be searched is asked and you have to dispaly message content of user who is logging currently to gmail and whose search message content is matched wt messages in inbox as well as in spam folder if any plz help..???</description> <content:encoded><![CDATA[<p>can any one give me code for the following program using IMAP&#8212;&#8211;&gt;<br
/> A GUI in which username and password along with the message content to be searched is asked and you have to dispaly message content of user who is logging currently to gmail and whose search message content is matched wt messages in inbox as well as in spam folder if any plz help..???</p> ]]></content:encoded> </item> <item><title>By: sarwar</title><link>http://davidwalsh.name/gmail-php-imap#comment-31567</link> <dc:creator>sarwar</dc:creator> <pubDate>Wed, 11 Apr 2012 07:29:35 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=2351#comment-31567</guid> <description>hi David,i have used ur code. But it prints these following php lines instead of output:seen ? &#039;read&#039; : &#039;unread&#039;).&#039;&quot;&gt;&#039;;
$output.= &#039;&#039;.$overview[0]-&gt;subject.&#039; &#039;;
$output.= &#039;&#039;.$overview[0]-&gt;from.&#039;&#039;;
$output.= &#039;on &#039;.$overview[0]-&gt;date.&#039;&#039;;
$output.= &#039;&#039;;/* output the email body */
$output.= &#039;&#039;.$message.&#039;&#039;;}echo $output;
}/* close the connection */
imap_close($inbox);#######my full code####david walsh code&lt;!--
div.toggler { border:1px solid #ccc; background:url(gmail2.jpg) 10px 12px #eee no-repeat; cursor:pointer; padding:10px 32px; }
div.toggler .subject { font-weight:bold; }
div.read { color:#666; }
div.toggler .from, div.toggler .date { font-style:italic; font-size:11px; }
div.body { padding:10px 20px; }
--&gt;window.addEvent(&#039;domready&#039;,function() {
var togglers = $$(&#039;div.toggler&#039;);
if(togglers.length) var gmail = new Fx.Accordion(togglers,$$(&#039;div.body&#039;));
togglers.addEvent(&#039;click&#039;,function() { this.addClass(&#039;read&#039;).removeClass(&#039;unread&#039;); });
//togglers[0].fireEvent(&#039;click&#039;); //first one starts out read
});&lt;?php
/* connect to yourserver */
$hostname = &#039;{gmail.com:993/imap/ssl}INBOX&#039;; /* Set this according to your own mail server*/
$username = &#039;myemail&#039;;
$password = &#039;mypass&#039;;/* try to connect */
$inbox = imap_open($hostname,$username,$password) or die(&#039;Cannot connect to yourdomain.com: &#039; . imap_last_error());/* grab emails */
$emails = imap_search($inbox,&#039;ALL&#039;);/* if emails are returned, cycle through each... */
if($emails) {/* begin output var */
$output = &#039;&#039;;/* put the newest emails on top */
rsort($emails);/* for every email... */
foreach($emails as $email_number) {/* get information specific to this email */
$overview = imap_fetch_overview($inbox,$email_number,0);
$message = imap_fetchbody($inbox,$email_number,1);/* output the email header information */
$output.= &#039;seen ? &#039;read&#039; : &#039;unread&#039;).&#039;&quot;&gt;&#039;;
$output.= &#039;&#039;.$overview[0]-&gt;subject.&#039; &#039;;
$output.= &#039;&#039;.$overview[0]-&gt;from.&#039;&#039;;
$output.= &#039;on &#039;.$overview[0]-&gt;date.&#039;&#039;;
$output.= &#039;&#039;;/* output the email body */
$output.= &#039;&#039;.$message.&#039;&#039;;}echo $output;
}/* close the connection */
imap_close($inbox);
?&gt;##
I hope I will get quick response. Thanks in advance.</description> <content:encoded><![CDATA[<p>hi David,</p><p>i have used ur code. But it prints these following php lines instead of output:</p><p>seen ? &#8216;read&#8217; : &#8216;unread&#8217;).&#8217;&#8221;&gt;&#8217;;<br
/> $output.= &#8221;.$overview[0]-&gt;subject.&#8217; &#8216;;<br
/> $output.= &#8221;.$overview[0]-&gt;from.&#8221;;<br
/> $output.= &#8216;on &#8216;.$overview[0]-&gt;date.&#8221;;<br
/> $output.= &#8221;;</p><p> /* output the email body */<br
/> $output.= &#8221;.$message.&#8221;;</p><p>}</p><p>echo $output;<br
/> }</p><p>/* close the connection */<br
/> imap_close($inbox);</p><p>#######my full code####</p><p>david walsh code</p><p></p><p>window.addEvent(&#8216;domready&#8217;,function() {<br
/> var togglers = $$(&#8216;div.toggler&#8217;);<br
/> if(togglers.length) var gmail = new Fx.Accordion(togglers,$$(&#8216;div.body&#8217;));<br
/> togglers.addEvent(&#8216;click&#8217;,function() { this.addClass(&#8216;read&#8217;).removeClass(&#8216;unread&#8217;); });<br
/> //togglers[0].fireEvent(&#8216;click&#8217;); //first one starts out read<br
/> });</p><p>&lt;?php<br
/> /* connect to yourserver */<br
/> $hostname = &#039;{gmail.com:993/imap/ssl}INBOX&#039;; /* Set this according to your own mail server*/<br
/> $username = &#039;myemail&#039;;<br
/> $password = &#039;mypass&#039;;</p><p>/* try to connect */<br
/> $inbox = imap_open($hostname,$username,$password) or die(&#039;Cannot connect to yourdomain.com: &#039; . imap_last_error());</p><p>/* grab emails */<br
/> $emails = imap_search($inbox,&#039;ALL&#039;);</p><p>/* if emails are returned, cycle through each&#8230; */<br
/> if($emails) {</p><p>/* begin output var */<br
/> $output = &#039;&#039;;</p><p>/* put the newest emails on top */<br
/> rsort($emails);</p><p>/* for every email&#8230; */<br
/> foreach($emails as $email_number) {</p><p>/* get information specific to this email */<br
/> $overview = imap_fetch_overview($inbox,$email_number,0);<br
/> $message = imap_fetchbody($inbox,$email_number,1);</p><p>/* output the email header information */<br
/> $output.= &#039;seen ? &#8216;read&#8217; : &#8216;unread&#8217;).&#8217;&#8221;&gt;&#8217;;<br
/> $output.= &#8221;.$overview[0]-&gt;subject.&#8217; &#8216;;<br
/> $output.= &#8221;.$overview[0]-&gt;from.&#8221;;<br
/> $output.= &#8216;on &#8216;.$overview[0]-&gt;date.&#8221;;<br
/> $output.= &#8221;;</p><p> /* output the email body */<br
/> $output.= &#8221;.$message.&#8221;;</p><p>}</p><p>echo $output;<br
/> }</p><p>/* close the connection */<br
/> imap_close($inbox);<br
/> ?&gt;</p><p>##<br
/> I hope I will get quick response. Thanks in advance.</p> ]]></content:encoded> </item> <item><title>By: Dhaval</title><link>http://davidwalsh.name/gmail-php-imap#comment-31439</link> <dc:creator>Dhaval</dc:creator> <pubDate>Wed, 04 Apr 2012 11:24:01 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=2351#comment-31439</guid> <description>Hi David,I am getting number of mails but didn&#039;t get any subject or other stuff even it throws below WarningWarning: imap_fetchbody() [function.imap-fetchbody]: Bad message number on line 24and below is my code$hostname = &quot;{imap.gmail.com:993/imap/ssl}INBOX&quot;;
$username = &quot;username&quot;;
$password = &quot;password&quot;;$inbox = imap_open($hostname,$username,$password);
$emails = imap_search($inbox,&#039;ALL&#039;);if($emails)
{
$output = &#039;&#039;;
rsort($emails);
foreach($emails as $email_numbers)
{
echo $email_numbers;
$overview = imap_fetch_overview($inbox,$email_number,0);
$message = imap_fetchbody($inbox,$email_number,2);
$output .= &#039;&#039;;
$output .= &#039;&#039;.$overview[0]-&gt;subject.&#039;&#039;;
$output .= &#039;&#039;.$overview[0]-&gt;from.&#039;&#039;;
/*		$output .= &#039;&#039;.$overview[0]-&gt;date.&#039;&#039;;*/
$output .= &#039;&#039;;
}
echo $output;
}imap_close($inbox);</description> <content:encoded><![CDATA[<p>Hi David,</p><p>I am getting number of mails but didn&#8217;t get any subject or other stuff even it throws below Warning</p><p>Warning: imap_fetchbody() [function.imap-fetchbody]: Bad message number on line 24</p><p>and below is my code</p><p>$hostname = &#8220;{imap.gmail.com:993/imap/ssl}INBOX&#8221;;<br
/> $username = &#8220;username&#8221;;<br
/> $password = &#8220;password&#8221;;</p><p>$inbox = imap_open($hostname,$username,$password);<br
/> $emails = imap_search($inbox,&#8217;ALL&#8217;);</p><p>if($emails)<br
/> {<br
/> $output = &#8221;;</p><p> rsort($emails);</p><p> foreach($emails as $email_numbers)<br
/> {<br
/> echo $email_numbers;</p><p> $overview = imap_fetch_overview($inbox,$email_number,0);<br
/> $message = imap_fetchbody($inbox,$email_number,2);</p><p> $output .= &#8221;;<br
/> $output .= &#8221;.$overview[0]-&gt;subject.&#8221;;<br
/> $output .= &#8221;.$overview[0]-&gt;from.&#8221;;<br
/> /*		$output .= &#8221;.$overview[0]-&gt;date.&#8221;;*/<br
/> $output .= &#8221;;</p><p> }</p><p> echo $output;<br
/> }</p><p>imap_close($inbox);</p> ]]></content:encoded> </item> <item><title>By: Dhaval</title><link>http://davidwalsh.name/gmail-php-imap#comment-31438</link> <dc:creator>Dhaval</dc:creator> <pubDate>Wed, 04 Apr 2012 11:05:45 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=2351#comment-31438</guid> <description>Hi David,I am getting numbers of mails but it didn&#039;t display mails and throwing below error&quot;Warning: imap_fetchbody() [function.imap-fetchbody]: Bad message number  line 24&quot;I can&#039;t get why its throwing this error?</description> <content:encoded><![CDATA[<p>Hi David,</p><p>I am getting numbers of mails but it didn&#8217;t display mails and throwing below error</p><p>&#8220;Warning: imap_fetchbody() [function.imap-fetchbody]: Bad message number  line 24&#8243;</p><p>I can&#8217;t get why its throwing this error?</p> ]]></content:encoded> </item> <item><title>By: mayur saxena</title><link>http://davidwalsh.name/gmail-php-imap#comment-31396</link> <dc:creator>mayur saxena</dc:creator> <pubDate>Sun, 01 Apr 2012 06:30:35 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=2351#comment-31396</guid> <description>&lt;code&gt;I am trying to run this script on my server but it shows nothing can you send me the original script please&lt;/code&gt;</description> <content:encoded><![CDATA[<p><code>I am trying to run this script on my server but it shows nothing can you send me the original script please</code></p> ]]></content:encoded> </item> <item><title>By: Bert-Jan</title><link>http://davidwalsh.name/gmail-php-imap#comment-31105</link> <dc:creator>Bert-Jan</dc:creator> <pubDate>Mon, 19 Mar 2012 11:21:31 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=2351#comment-31105</guid> <description>Thanks, this was most helpful !</description> <content:encoded><![CDATA[<p>Thanks, this was most helpful !</p> ]]></content:encoded> </item> <item><title>By: Jan</title><link>http://davidwalsh.name/gmail-php-imap#comment-29308</link> <dc:creator>Jan</dc:creator> <pubDate>Thu, 16 Feb 2012 16:24:51 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=2351#comment-29308</guid> <description>Wow, i&#039;ve been looking for such simple code for long time. And your live demo made me believe again, that accessing GMail via PHP can actually work. :-)I am wondering if there are any special requirements (php-imap client version or so) since I never get connected with imap_open on my environment. all ports opened. latest php release.wbr
Jan</description> <content:encoded><![CDATA[<p>Wow, i&#8217;ve been looking for such simple code for long time. And your live demo made me believe again, that accessing GMail via PHP can actually work. :-)</p><p>I am wondering if there are any special requirements (php-imap client version or so) since I never get connected with imap_open on my environment. all ports opened. latest php release.</p><p>wbr<br
/> Jan</p> ]]></content:encoded> </item> <item><title>By: Mark</title><link>http://davidwalsh.name/gmail-php-imap#comment-29219</link> <dc:creator>Mark</dc:creator> <pubDate>Mon, 13 Feb 2012 23:19:59 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=2351#comment-29219</guid> <description>Hi,Is there any way to figure out the size of the gmail account using API, prior to downloading the emails?Thanks,-Mark</description> <content:encoded><![CDATA[<p>Hi,</p><p>Is there any way to figure out the size of the gmail account using API, prior to downloading the emails?</p><p>Thanks,</p><p>-Mark</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 2/7 queries in 0.008 seconds using disk: basic
Object Caching 813/813 objects using disk: basic

Served from: davidwalsh.name @ 2012-05-22 18:50:15 -->
