Programmatically searching GMail?

前端 未结 4 1019
北荒
北荒 2021-02-04 15:56

Is there any way to programmatically search GMail, preferably using C#?

For example, I\'d like to get all email messages matching the search label:MyLabel from:no_re

相关标签:
4条回答
  • 2021-02-04 16:15

    To use a full gmail search (like multi labels, boolean operators) via IMAP, you need to use X-GM-RAW attribute. More on Google Apps docs.

    0 讨论(0)
  • 2021-02-04 16:26

    Create an IMAP client, or use a library, to access Gmail and search for e-mail messages. The IMAP protocol explicitly supports searching on the server-side. Make sure IMAP access is enabled for the Gmail account.

    Note that in Gmail, labels are treated like IMAP folders.

    0 讨论(0)
  • 2021-02-04 16:28

    it's 2015 now! You can use Google's Gmail API.

    It has a search feature, you can do it easily just like this:

    https://www.googleapis.com/gmail/v1/users/me/messages?q="in:sent after:2014/01/01 before:2014/01/30"
    
    0 讨论(0)
  • 2021-02-04 16:31

    Eventually, I settled with using IMAPX, which works pretty well. Tried a few other IMAP libraries which weren't as powerful and seemed a bit flaky.

    If anyone's interested, the outcome of this is iDevice App Reporter, which is a WinForms app that searches GMail (or any other IMAP mailbox) for iTunes app receipts and parses these to return a list of downloaded/purchased apps from the Apple AppStore.

    0 讨论(0)
提交回复
热议问题