public class ImapClientGmail : ImapClient
    {
        public ImapClientGmail()
            : base()
        {
        }

        public ImapClientGmail(string host, string username, string password, ImapClient.AuthMethods method = ImapClient.AuthMethods.Login, int port = 143, bool secure = false, bool skipSslValidation = false)
            : base(host, username, password, method, port, secure, skipSslValidation)
        {

        }

        public string GETTAG()
        {
            var method = typeof(ImapClient).GetMethod("GetTag", BindingFlags.NonPublic | BindingFlags.Instance);
            return (string)method.Invoke(this, null);
        }  

        public string AddLabel(string Uid, string label)
        {
            string command = string.Format("{0}UID STORE {1} +X-GM-LABELS (\"{2}\")", GETTAG(), Uid, label);
            return SendCommandGetResponse(command);
        }
}

Comments

Popular posts from this blog

Distance between two gps coordinates?