Read Gmail Inbox

后端 未结 2 658
迷失自我
迷失自我 2020-12-09 23:54

I want to read my Gmail Inbox by using Google.GData.Client.dll. How do I accomplish this? I would like a sample program.

2条回答
  •  余生分开走
    2020-12-10 00:33

    Use aenetmail's IMAP client: github. I think it's a better alternative than GMailAtomFeed because you can retrieve the entire body of the emails and it has many many more options.

    Here's 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
    }
    

提交回复
热议问题