tags:

views:

95

answers:

3

Hi

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.

+2  A: 

Hope this page on code gallery will help you.

TheVillageIdiot
+1  A: 

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.

saurabh
+2  A: 

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