通过C#应用程序阅读最新的Gmail消息

通过C#应用程序阅读最新的Gmail消息,c#,email,gmail,C#,Email,Gmail,可能重复: 我需要在C#Visual Studio中制作一个应用程序,以便能够阅读Gmail帐户的最新电子邮件。我只需要进入3个文本框:From、Subject和bodymessage 但我只需要得到最近收到的电子邮件的信息。拜托,伙计们,我真的需要你们的帮助 非常感谢:)尝试阅读有关POP3、IMAP协议的内容 这里是VisualStudio示例,一旦您可以阅读电子邮件,就可以根据邮件日期检查服务器并选择最新的 http://archive.msdn.microsoft.com/CSharp

可能重复:

我需要在C#Visual Studio中制作一个应用程序,以便能够阅读Gmail帐户的最新电子邮件。我只需要进入3个文本框:From、Subject和bodymessage

但我只需要得到最近收到的电子邮件的信息。拜托,伙计们,我真的需要你们的帮助


非常感谢:)

尝试阅读有关POP3、IMAP协议的内容 这里是VisualStudio示例,一旦您可以阅读电子邮件,就可以根据邮件日期检查服务器并选择最新的

http://archive.msdn.microsoft.com/CSharpGmail
代码如下:

  // 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; 
   }

你试过什么?我建议您查找POP3库并开始研究…答案通常包含一些代码。。。我不明白你为什么不把它作为一个评论?下一次,我会为你的违规行为道歉…因为这个问题需要一个通用的实现,所以共享了包含代码的链接。。!!很抱歉+1一点也不担心。在(和超级用户)回答中,通常会包括链接内容的摘要或专门回答问题的要点。SE站点的目标是在未来几年成为知识和答案的资源。对于只有链接的答案,op必须挖掘其他资源,以找到他/她可能不确定的答案。最重要的是,如果你的链接曾经中断,你的答案对于将来访问此页面的任何人都是无用的。我对你的答案进行了编辑以添加更多细节。祝你好运