Beispiel #1
0
 public JsonResult TestConnection(RequestSmtp requestSmtp)
 {
     try
     {
         SendingEmailhelper testEmail = new SendingEmailhelper();
         var result = testEmail.TestEmail(Convert.ToString(Session["EmailId"]));
         if (result == "Successful")
         {
             return(Json(new { status = "Success" }, JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json(new { status = "Failed" }, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #2
0
        public JsonResult SetDefaultConnection(RequestSmtp requestSmtp)
        {
            if (requestSmtp.SmtpProviderId != null)
            {
                var result = _processSettings.SettingDefaultConnection(requestSmtp.SmtpProviderId);

                if (result > 0)
                {
                    return(Json(new { status = "Success" }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(new { status = "Failed" }, JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                return(Json(new { status = "Failed" }, JsonRequestBehavior.AllowGet));
            }
        }