protected void lnkforward_Click(object sender, EventArgs e) { LinkButton lnk = sender as LinkButton; GridViewRow row = lnk.NamingContainer as GridViewRow; int id = int.Parse(grd_app_rej.DataKeys[row.RowIndex].Value.ToString()); bus.lid = id; bus.userid = int.Parse(Session["user_id"].ToString()); int r = bus.approve_leave(); if (r == 1) { fetch_mail_details_hr(); mailbody = "<table border='1' cellpadding='0' cellspacing='0' style='width: 850px; border-color: black;'><tr><td colspan='9'><br>   Dear " + row.Cells[2].Text.ToString() + ",<br /><br />     Leave application submitted by you is <b>Approved </b> on " + DateTime.Now.ToString("dd/MM/yyyy") + ".</b> The details are as follows.<br /><br /></td></tr><tr style='font-weight: 700;'></tr><tr><td colspan='9'><br/><p></p><p>    Name: " + row.Cells[2].Text.ToString() + "</p><p>   Department: " + row.Cells[3].Text.ToString() + "</p><p>   Designation: " + row.Cells[4].Text.ToString() + " </p><p>   Leave Type: " + row.Cells[5].Text.ToString() + " </p><p>   Period: " + row.Cells[7].Text.ToString() + " </p><p>   Reason: " + row.Cells[8].Text.ToString() + " </p><p>   click<a href=" + url2 + "> here </a>to login into the application (UOA)</p><p>   click<a href=" + url + "> here </a>to login into the application</p><br/></td></tr><tr></tr><td colspan='9' style='font-weight: bold' align='right'><br /><br />Regards,<br />Team e-leave</td></tr><tr><td align='center'><p style='color:blue;'> This is a system generated response. Please do not respond to this email id.</p></td></tr></table>"; bool check = SendWebMail(row.Cells[11].Text.ToString(), "Leave Application Notification", mailbody, toemail, "", "*****@*****.**"); if (check == true) { fillleavesapr(); ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "success();", true); } else { fillleavesapr(); ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "warningemail();", true); } } else { fillleavesapr(); ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "error();", true); } }