public void SendMail() { try { SendMail SS = new SendMail(); // MHRISesstion.CandidateId = "187"; //MHRISesstion.HREmailid = "*****@*****.**"; //MHRISesstion.HREmailid = "*****@*****.**"; //MHRISesstion.HREmailid = "*****@*****.**"; SS.SendEmail(Convert.ToInt32(MHRISesstion.CandidateId), System.DateTime.Now.ToString("dd/MM/yyyy")); } catch (Exception ex) { lblerror.Visible = true; lblerror.Text = Convert.ToString(ex.Message); throw ex; } }