3

I want to show how many unread emails I have in my inbox (gmail) and show this number in a label.

e.g Inbox(3)

I've tried a load of sites but couldn't get anything.

I'm new to programming in general so any help would be great.

TheVillageIdiot
  • 40,053
  • 20
  • 133
  • 188
Shane121
  • 423
  • 1
  • 7
  • 17
  • ok i found this code on http://stackoverflow.com/questions/989986/reading-atom-feed-of-gmail-account-from-c at the very bottom it has a soulution to autheniticate the atom feed so how owuld i go about parsing the xml and showing it in a label thanks for all the help – Shane121 Aug 21 '10 at 19:24

3 Answers3

3

Hope this page on code gallery will help you.

TheVillageIdiot
  • 40,053
  • 20
  • 133
  • 188
3

The simplest is to do a query to: http://mail.google.com/mail/feed/atom/unread/

You can read more about it here: http://googlesystem.blogspot.com/2008/03/feed-for-unread-gmail-messages.html

As pointed out by @TheVillageIdiot, there is a the code gallery at http://code.msdn.microsoft.com/CSharpGmail . Scroll down and read about GmailAtomFeed.

Ants
  • 2,628
  • 22
  • 35
1

You need to do something like below.

1- Maintain a column (Say IsReaded) in the database table if you are using some database table to store your email.

1- When ever user clicks an email , you need to update the column in database table to 'Y'.

you can do this task asynchronously, using Ajax

2- Just use this Sql ' select count(1) from tblMessages where IsRead ='N''

3- than update the label with the count.

TalentTuner
  • 17,262
  • 5
  • 38
  • 63