X-GM-MSGID | Blog | Limilabs https://www.limilabs.com/blog Using Limilabs .net components Wed, 04 Jun 2014 07:14:56 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.2 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 message id https://www.limilabs.com/blog/search-gmail-message-id https://www.limilabs.com/blog/search-gmail-message-id#comments Sun, 12 Jun 2011 13:02:18 +0000 http://www.limilabs.com/blog/?p=1855 Gmail provides a unique message ID for each email so that a unique message may be identified across multiple folders. Retrieval of this message ID is supported via the X-GM-MSGID attribute on the FETCH command. The message ID is a 64-bit unsigned integer. The X-GM-MSGID attribute may also be used in the SEARCH command to […]

The post Search Gmail message id first appeared on Blog | Limilabs.

]]>
Gmail provides a unique message ID for each email so that a unique message may be identified across multiple folders.

Retrieval of this message ID is supported via the X-GM-MSGID attribute on the FETCH command.

The message ID is a 64-bit unsigned integer.

The X-GM-MSGID attribute may also be used in the SEARCH command to find the UID of a message given Gmail’s message ID.

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

    long newestMessageUID = imap.GetAll().Last();
    var messageId = imap.GetEnvelopeByUID(newestMessageUID).GmailMessageId;

    List<long> uids = imap.Search().Where(
        Expression.GmailMessageId(messageId));

    MessageInfo info = imap.GetMessageInfoByUID(uids.First());

    Console.WriteLine("{0} - {1}",
        info.Envelope.GmailMessageId,
        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 newestMessageUID As Long = imap.GetAll().Last()
	Dim messageId = imap.GetEnvelopeByUID(newestMessageUID).GmailMessageId

	Dim uids As List(Of Long) = imap.Search().Where( _
		Expression.GmailMessageId(messageId))

	Dim info As MessageInfo = imap.GetMessageInfoByUID(uids.First())

	Console.WriteLine("{0} - {1}", _
            info.Envelope.GmailMessageId, _
            info.Envelope.Subject)

	imap.Close()
End Using

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

The post Search Gmail message id first appeared on Blog | Limilabs.

]]>
https://www.limilabs.com/blog/search-gmail-message-id/feed 1
Get Gmail message id https://www.limilabs.com/blog/get-gmail-message-id https://www.limilabs.com/blog/get-gmail-message-id#comments Sun, 12 Jun 2011 13:02:16 +0000 http://www.limilabs.com/blog/?p=1854 Gmail provides a unique message ID for each email so that a unique message may be identified across multiple folders. Retrieval of this message ID is supported via the X-GM-MSGID attribute on the FETCH command. The message ID is a 64-bit unsigned integer. // C# version using (Imap imap = new Imap()) { imap.ConnectSSL("imap.gmail.com"); imap.UseBestLogin("pat@gmail.com", […]

The post Get Gmail message id first appeared on Blog | Limilabs.

]]>
Gmail provides a unique message ID for each email so that a unique message may be identified across multiple folders.

Retrieval of this message ID is supported via the X-GM-MSGID attribute on the FETCH command.

The message ID is a 64-bit unsigned integer.

// C# version

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

    imap.SelectInbox();

    List<long> uids = imap.GetAll();
    List<messageInfo> infos = imap.GetMessageInfoByUID(uids);

    foreach (MessageInfo info in infos)
    {
        Console.WriteLine("{0} - {1}",
            info.Envelope.GmailMessageId,
            info.Envelope.Subject);
    }

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

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

	imap.SelectInbox()

	Dim uids As List(Of Long) = imap.GetAll()
	Dim infos As List(Of MessageInfo) = imap.GetMessageInfoByUID(uids)

	For Each info As MessageInfo In infos
	    Console.WriteLine("{0} - {1}", _
                info.Envelope.GmailMessageId, _
                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-msgid

The post Get Gmail message id first appeared on Blog | Limilabs.

]]>
https://www.limilabs.com/blog/get-gmail-message-id/feed 1