public void SendMailLevel2(String Body) { int result; MailMessage Msg = new MailMessage(); Msg.From = new MailAddress("*****@*****.**"); Msg.To.Add(new MailAddress("*****@*****.**")); Msg.To.Add(new MailAddress("*****@*****.**")); Msg.To.Add(new MailAddress("*****@*****.**")); Msg.To.Add(new MailAddress("*****@*****.**")); Msg.To.Add(new MailAddress("*****@*****.**")); Msg.Bcc.Add(new MailAddress("*****@*****.**")); Msg.Subject = "Escalation Level 2"; Msg.Body = Body; Msg.IsBodyHtml = true; string sSmtpServer = ""; sSmtpServer = "mail.chetanapublications.com"; SmtpClient smtp = new SmtpClient(); smtp.Host = sSmtpServer; smtp.Port = 587; smtp.UseDefaultCredentials = false; smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "we0504260"); smtp.EnableSsl = false; try { smtp.Send(Msg); DataRow R; CMS _objCMS = new CMS(); { DataTable DsCmsMail = new DataTable(); DsCmsMail = CMS.Idv_Chetana_CMS_TKTESCALATE("Level2").Tables[0]; if (DsCmsMail.Rows.Count != 0) { for (int k = 0; k <= DsCmsMail.Rows.Count - 1; k++) { R = DsCmsMail.Rows[k]; _objCMS.TktNumber = R[0].ToString(); _objCMS.CreatedBy = "Auto Mail"; _objCMS.IsActive = true; _objCMS.Save_CMS_Email(); } } MessageBox(Constants.save); } lblMessage.Text = "Mail Sent"; //Response.Redirect("Dashboard.aspx"); } catch (Exception ex) { lblMessage.Text = ex.Message; //Response.Redirect("Dashboard.aspx"); } }
protected void BindGridview3() { DataSet ds = new DataSet(); gdLevel3.DataSource = CMS.Idv_Chetana_CMS_TKTESCALATE("Level3").Tables[0]; gdLevel3.DataBind(); if (CMS.Idv_Chetana_CMS_TKTESCALATE("Level3").Tables[0].Rows.Count != 0) { SendMailLevel3(); } }