Example #1
0
        public Mail getemail(string id, string email)
        {
            Mail m = new Mail();

            try
            {
                string Result           = PHPRequests.HttpRequest(Appcontext.resource + "/v1.0/users/" + email + "/messages/" + id, string.Empty, this.Authetication, Constants.Get, string.Empty);
                JavaScriptSerializer js = new JavaScriptSerializer();
                m = js.Deserialize <Mail>(Result);
            }
            catch (Exception e) { }
            return(m);
        }
Example #2
0
        public auth gettokenbyrefresh(string tenantId)
        {
            Dictionary <string, string> d = new Dictionary <string, string>();

            d.Add(Constants.grant_type, Constants.client_credentials);
            d.Add(Constants.client_id, Appcontext.client_id);
            d.Add(Constants.client_secret, Appcontext.client_secret);
            d.Add(Constants.resource, Appcontext.resource);
            string s = PHPRequests.RequestToPHPSync(d, Appcontext.urlof365 + tenantId + "/oauth2/token");
            JavaScriptSerializer js = new JavaScriptSerializer();
            auth authres            = js.Deserialize <auth>(s);

            return(authres);
        }
Example #3
0
        public Mail moveEmail(string id, string folder, string email)
        {
            Mail m = new Mail();

            try
            {
                Move move = new Move()
                {
                    destinationId = folder
                };
                string json             = new JavaScriptSerializer().Serialize(move);
                string Result           = PHPRequests.HttpRequest(Appcontext.resource + "/v1.0/users/" + email + "/messages/" + id + "/move", json, this.Authetication, Constants.Get, string.Empty);
                JavaScriptSerializer js = new JavaScriptSerializer();
                m = js.Deserialize <Mail>(Result);
            }
            catch (Exception e) { }
            return(m);
        }