-
May 17th, 2011, 02:24 AM
#1
How to get unread mail count of GMail in VC++
Hello
I want to get unread mail count in VC++. I have done it in C#.Net with following code -
Collection<UnreadMails> GetNewMails()
{
WebRequest webGmailRequest = WebRequest.Create(@"https://mail.google.com/mail/feed/atom");
webGmailRequest.PreAuthenticate = true;
NetworkCredential loginCredentials = new NetworkCredential(txtUserName.Text.Trim(), txtUserPassword.Text.Trim());
webGmailRequest.Credentials = loginCredentials;
WebResponse webGmailResponse = webGmailRequest.GetResponse();
Stream strmUnreadMailInfo = webGmailResponse.GetResponseStream();
StringBuilder sbUnreadMailInfo = new StringBuilder(); byte[] buffer = new byte[8192]; int byteCount = 0;
while ((byteCount = strmUnreadMailInfo.Read(buffer, 0, buffer.Length)) > 0)
sbUnreadMailInfo.Append(System.Text.Encoding.ASCII.GetString(buffer, 0, byteCount));
XmlDocument UnreadMailXmlDoc = new XmlDocument();
UnreadMailXmlDoc.LoadXml(sbUnreadMailInfo.ToString());
XmlNodeList UnreadMailEntries = UnreadMailXmlDoc.GetElementsByTagName("entry");
}
So by using url "https://mail.google.com/mail/feed/atom" and provide login credential, i am able to get a XML file which contain unread mail information.
The same i want to do in VC++.
Can anybody help me????
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|