Пример #1
0
        public ActionResult resendemaildetail(sendemail data)
        {
            var detail = db.StudentEmailDetails.Where(x => x.Id == data.Id).FirstOrDefault();
            var master = db.StudentEmailMasters.Where(x => x.Id == detail.MastId).FirstOrDefault();

            detail.Response = EmailResponce.Draft;
            var           files    = master.StudentEmailFiles;
            List <string> allfiles = new List <string>();

            foreach (var i in files)
            {
                string path        = "/Images/" + "Mailes/" + i.URL;
                string dicrectory2 = Request.MapPath(path);
                allfiles.Add(dicrectory2);
            }
            List <sendemail> list = new List <sendemail>();

            list.Add(new sendemail()
            {
                Id = detail.Id, Email = detail.Email
            });
            string ToEmail  = "*****@*****.**";
            var    Response = WebUtil.SchoolToParent(ToEmail, list, master.MailContent, master.Subject, allfiles) ? "Sent" : "Failed";

            detail.Response  = Response;
            detail.CreatedOn = DateTime.Now;
            db.SaveChanges();
            return(Json(data, JsonRequestBehavior.AllowGet));
        }
 public ActionResult SendEmailView(sendemail snd)
 {
     MiddleTyre.SendEmailView(snd);
     return(View("Adminloggedin"));
 }