X-GM-RAW | Blog | Limilabs https://www.limilabs.com/blog Wed, 04 Jun 2014 07:13:23 +0000 en-US hourly 1 https://wordpress.org/?v=6.3.4 Gmail extensions in Mail.dll https://www.limilabs.com/blog/gmail-extensions-in-mail-dll https://www.limilabs.com/blog/gmail-extensions-in-mail-dll#comments Mon, 13 Jun 2011 13:05:11 +0000 http://www.limilabs.com/blog/?p=1907 Here’s the list of Gmail IMAP protocol extensions implemented in Mail.dll: Extension of the LIST command: XLIST Extension of the SEARCH command: X-GM-RAW Access to the Gmail unique message ID: X-GM-MSGID Access to the Gmail thread ID: X-GM-THRID Access to Gmail labels: X-GM-LABELS OAuth and OAuth 2.0: XOAUTH, XOAUTH2 You can read on how to […]

The post Gmail extensions in Mail.dll first appeared on Blog | Limilabs.

]]>

Here’s the list of Gmail IMAP protocol extensions implemented in Mail.dll:

  • Extension of the LIST command: XLIST
  • Extension of the SEARCH command: X-GM-RAW
  • Access to the Gmail unique message ID: X-GM-MSGID
  • Access to the Gmail thread ID: X-GM-THRID
  • Access to Gmail labels: X-GM-LABELS
  • OAuth and OAuth 2.0: XOAUTH, XOAUTH2

You can read on how to use Mail.dll with Gmail in the following articles:

OAuth 2.0

OAuth 1.0

The post Gmail extensions in Mail.dll first appeared on Blog | Limilabs.

]]>
https://www.limilabs.com/blog/gmail-extensions-in-mail-dll/feed 1
Search Gmail using Gmail’s search syntax https://www.limilabs.com/blog/search-gmail-using-gmails-search-syntax https://www.limilabs.com/blog/search-gmail-using-gmails-search-syntax#comments Sun, 12 Jun 2011 13:02:20 +0000 http://www.limilabs.com/blog/?p=1856 To provide access to the full Gmail search syntax, Gmail provides the X-GM-RAW search attribute. Arguments passed along with the X-GM-RAW attribute when executing the SEARCH command will be interpreted in the same manner as in the Gmail web interface. You can learn more about this Gmail IMAP extension here: http://code.google.com/apis/gmail/imap/#x-gm-raw

The post Search Gmail using Gmail’s search syntax first appeared on Blog | Limilabs.

]]>
To provide access to the full Gmail search syntax, Gmail provides the X-GM-RAW search attribute.

Arguments passed along with the X-GM-RAW attribute when executing the SEARCH command will be interpreted in the same manner as in the Gmail web interface.

// C# version

using (Imap imap = new Imap())
{
    imap.ConnectSSL("imap.gmail.com");
    imap.UseBestLogin("pat@gmail.com", "password");

    // Select 'All Mail' folder
    CommonFolders common = new CommonFolders(client.GetFolders());
    client.Select(common.AllMail);

    List<long> uids = imap.Search().Where(
        Expression.GmailRawSearch(
            "in:inbox subject:Notification with -without"));

    foreach (MessageInfo info in imap.GetMessageInfoByUID(uids))
    {
        Console.WriteLine("{0} - {1}",
            info.Envelope.GmailThreadId,
            info.Envelope.Subject);
    }

    imap.Close();
}
' VB.NET version

Using imap As New Imap()
	imap.ConnectSSL("imap.gmail.com")
	imap.UseBestLogin("pat@gmail.com", "password")

	' Select 'All Mail' folder
	Dim common As New CommonFolders(client.GetFolders())
	client.Select(common.AllMail)

	Dim uids As List(Of Long) = imap.Search().Where( _
            Expression.GmailRawSearch( _
                "in:inbox subject:Notification with -without"))

	For Each info As MessageInfo In imap.GetMessageInfoByUID(uids)
	    Console.WriteLine("{0} - {1}",  _
                info.Envelope.GmailThreadId,  _
                info.Envelope.Subject)
	Next

	imap.Close()
End Using

You can learn more about this Gmail IMAP extension here:
http://code.google.com/apis/gmail/imap/#x-gm-raw

The post Search Gmail using Gmail’s search syntax first appeared on Blog | Limilabs.

]]>
https://www.limilabs.com/blog/search-gmail-using-gmails-search-syntax/feed 1