Reading Gmail Inbox

I want to read the Gmail inbox using Google.GData.Client.dll . How to do it? I would like to try the program.

+4
source share
2 answers

I found GMailAtomFeed

  // Create the object and get the feed RC.Gmail.GmailAtomFeed gmailFeed = new RC.Gmail.GmailAtomFeed("username", "password"); gmailFeed.GetFeed(); // Access the feeds XmlDocument XmlDocument myXml = gmailFeed.FeedXml // Access the raw feed as a string string feedString = gmailFeed.RawFeed // Access the feed through the object string feedTitle = gmailFeed.Title; string feedTagline = gmailFeed.Message; DateTime feedModified = gmailFeed.Modified; //Get the entries for(int i = 0; i < gmailFeed.FeedEntries.Count; i++) { entryAuthorName = gmailFeed.FeedEntries[i].FromName; entryAuthorEmail = gmailFeed.FeedEntries[i].FromEmail; entryTitle = gmailFeed.FeedEntries[i].Subject; entrySummary = gmailFeed.FeedEntries[i].Summary; entryIssuedDate = gmailFeed.FeedEntries[i].Received; entryId = gmailFeed.FeedEntries[i].Id; } 

also you have to watch

http://code.msdn.microsoft.com/CSharpGmail

http://weblogs.asp.net/satalajmore/archive/2007/12/19/asp-net-read-email.aspx

+5
source

Use aenetmail IMAP client: github . I think this is the best alternative to GMailAtomFeed, because you can get all the email text, and it has many other features.

Here is an example:

 using (var ic = new AE.Net.Mail.ImapClient("imap.gmail.com", "email", "pass", AE.Net.Mail.AuthMethods.Login, 993, true)) { ic.SelectMailbox("INBOX"); MailMessage[] mm = ic.GetMessages(0, 10); // at this point you can download the messages } 
0
source

Source: https://habr.com/ru/post/1332355/


All Articles