<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener("load", function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <iframe src="http://www.blogger.com/navbar.g?targetBlogID=8211560&amp;blogName=Web+Development+Tips%2C+Tricks+%26+Trivia&amp;publishMode=PUBLISH_MODE_BLOGSPOT&amp;navbarType=BLUE&amp;layoutType=CLASSIC&amp;searchRoot=http%3A%2F%2Fmvark.blogspot.com%2Fsearch&amp;blogLocale=en_IN&amp;homepageUrl=http%3A%2F%2Fmvark.blogspot.com%2F" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" height="30px" width="100%" id="navbar-iframe" allowtransparency="true" title="Blogger Navigation and Search"></iframe> <div></div>

Web Development Tips, Tricks & Trivia

by 'Anil' Radhakrishna
A seasoned developer's little discoveries and annotated bookmarks.

Search from over a hundred Web Development HOW TO articles, Tips and Tricks


HOW TO fetch unread emails from a mail server

I learnt today that fetching unread email messages is not natively supported by POP3.
The POP3 protocol does not provide the ability to ask the server which emails are "unread". Furthermore, a pure POP3 server does not even keep this information. Some servers, such as Exchange Server, expose both POP3 and IMAP interfaces. In these cases, information about read/unread status exists on the server, but it is only available via the IMAP protocol.

There is a code sample on getting the list of unread messages from an IMAP server using a commerical component Rebex Mail for .NET. Although I haven't tried, I guess this can be achieved using IMAP components like these -
IPWorks! IMAP Component from /n software
Rebex Mail for .NET
Chilkat IMAP .NET
EAGetMail IMAP4 Component
Lumisoft (free)
xemail-net (free)
InterIMAP (free)

So what's the difference between IMAP and POP? An answer from the Gmail FAQ -
Unlike POP, IMAP offers two-way communication between your web Gmail and your email client(s). This means when you log in to Gmail using a web browser, actions you perform on email clients and mobile devices (ex: putting mail in a 'work' folder) will instantly and automatically appear in Gmail (ex: it will already have a 'work' label on that email the next time you sign in).

IMAP also provides a better method to access your mail from multiple devices. If you check your email at work, on your mobile phone, and again at home, IMAP ensures that new mail is accessible from any device at any given time.

Finally, IMAP offers a more stable experience overall. Whereas POP is prone to losing messages or downloading the same messages multiple times, IMAP avoids this through two-way syncing capabilities between your mail clients and your web Gmail.

If you're trying to decide between using POP and using IMAP with Gmail, we recommend IMAP.

Also see:
HOW TO avoid Spam Filters while emailing programmatically
HOW TO view only the unread messages in your Gmail inbox
So, you want to be a Gmail ninja?

Labels: ,

« Home | Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »

Links to this post:

Create a Link


»

Post a Comment



» Add to Technorati Favorites

Popular Posts

» HOW TO add a header or footer to a dynamically generated Word document
» HOW TO make web pages "cross browser"
» HOW TO show UTC Date/Time recorded on the server in the user's regional time zone format
» HOW TO control ASP.NET's Adaptive Rendering behavior
» Book Review: MCTS Self-Paced Training Kit (Exam 70-536): Microsoft .NET Framework 2.0 Application Development Framework
» HOW TO send an email programmatically using C# with GMail