Exemple #1
0
    public static string envio_correo(SqlString from, SqlString to, SqlString subject, SqlString htmlbody, SqlString textbody)
    {
        string gRequest = "";

        try
        {
            Swagger     Swagger = new Swagger();
            Ent_Swagger data    = new Ent_Swagger();

            data.From     = from;
            data.To       = to;
            data.Subject  = subject;
            data.HtmlBody = htmlbody;
            data.TextBody = textbody;

            //data.From = "*****@*****.**";
            //data.To = "*****@*****.**";
            //data.Subject = "titulo email";
            //data.HtmlBody = "<h1>hola2</h1>";
            //data.TextBody = "Que tal";

            //string jsonData = js.Serialize(data);

            //var  jsonData1 = (JsonConvert.DeserializeObject)data;//js.Serialize(data);

            //var serializer = new JavaScriptSerializer();
            //var ss=n
            //var jsonData = JsonConvert.SerializeObject(data);

            //var jsondata = Correo.JsonConverter.Serialize(data);

            string jsonData = convert_object_jason(data);

            gRequest = Swagger.sendEmail(jsonData);

            //JavaScriptSerializer js = new JavaScriptSerializer();
            //var  jsonData = JsonConvert.DeserializeObject<>(data);//js.Serialize(data);
            //gRequest = Swagger.sendEmail(jsonData);
        }
        catch (Exception exc)
        {
            gRequest = exc.Message;
        }
        return(gRequest);
    }