protected void btnConfirm_Click(object sender, EventArgs e) { var objMailTemplates = new MailTemplates(); var collegeName = ""; var objConsulling = new Consulling(); try { var ds = objConsulling.GetIntertestedCollege(ObjSecure.LoggedInUserId); if (ds != null && ds.Tables.Count > 0) { for (var i = 0; i < ds.Tables[0].Rows.Count; i++) { collegeName += "<div><strong>" + (i + 1) + ". " + ds.Tables[0].Rows[i]["AjCollegeBranchName"] + "</strong></div><br/>"; } var mail = new MailMessage { From = new MailAddress(ApplicationSettings.Instance.Email), Subject = "AdmissionJankari:Counselling Information" }; var body = objMailTemplates.MailBodyForCOunsellingQuery(new SecurePage().LoggedInUserName, collegeName.TrimEnd(',')); mail.Body = body; mail.To.Add(new SecurePage().LoggedInUserEmailId); Utils.SendMailMessageAsync(mail); Response.Redirect(Utils.ApplicationRelativeWebRoot + "counselling/Payment.aspx"); } } catch (Exception ex) { var err = ex.Message; if (ex.InnerException != null) { err = err + " :: Inner Exception :- " + ex; } const string addInfo = "Error while executing btnConfirm_Click in UcUserFinalList.ascx :: -> "; var objPub = new ClsExceptionPublisher(); objPub.Publish(err, addInfo); } }