ImapUtilsGmailSearch Method
Creates IMAP search query of Gmail type.

Namespace: MailBee.ImapMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.2.0 build 630 for .NET 4.5
public static string GmailSearch(
	string s


Type: SystemString
Search condition.

Return Value

Type: String
The string containing Gmail search condition wrapped with X-GM-RAW verb.
MailBeeInvalidArgumentException The specified string is a null reference (Nothing in Visual Basic).

This method lets you use search conditions in Gmail syntax when you work with Gmail-compatible server. For instance, s can be has:attachment in:unread or SomeWord or "Any text" in:read. MailBee wraps it with a special IMAP search verb (X-GM-RAW) recognized by Gmail so that you can supply it to Search(Boolean, String, String) method to find items with a familiar and flexible Gmail syntax. For instance, it allows for finding attachments while the standard IMAP syntax doesn't.

Non-ASCII text is encoded in UTF-8 with this method. Thus, if you search non-ASCII, you must pass "utf-8" as charset value when calling Search(Boolean, String, String) method.

Note Note
The mail server must support Gmail search syntax ("x-gm-ext-1" capability must be listed in GetExtensions results). See Google IMAP Extensions for details.
See Also