private void mail(int incid_id, string area, string clasif, string desc, string fecha, string estatus, string user, int areaID) { string bodytext; string involucrados = ""; tbl_personEventTableAdapter involuc = new tbl_personEventTableAdapter(); DataSet1.tbl_personEventDataTable tblinvoluc = new DataSet1.tbl_personEventDataTable(); involuc.FillByIncid(tblinvoluc, user, incid_id); for (int i = 0; i <= tblinvoluc.Rows.Count - 1; i++) { if (!(String.IsNullOrEmpty(Convert.ToString(tblinvoluc.Rows[i]["perEvent_numEmploy"])))) { involucrados += "No. empleado: " + tblinvoluc.Rows[i]["perEvent_numEmploy"] + " \n\n"; } involucrados += "Nombre de la persona: " + tblinvoluc.Rows[i]["perEvent_name"] + " \n "; involucrados += "Empresa: " + tblinvoluc.Rows[i]["perEvent_company"] + " \n "; involucrados += "Area funcional: " + tblinvoluc.Rows[i]["area_id"] + " \n\n "; } involuc.Dispose(); tblinvoluc.Dispose(); tbl_incidentTableAdapter incid = new tbl_incidentTableAdapter(); tbl_statusTableAdapter stat = new tbl_statusTableAdapter(); bodytext = "\nPor medio del presente se notifica que ha ocurrido un accidente no." + incid_id + " del día " + fecha + " \n"; bodytext = bodytext + "\n Area: " + area + "\n"; bodytext = bodytext + " Clasificación del Incidente: " + clasif + "\n"; bodytext = bodytext + "\n Descripción del Incidente: " + desc + "\n"; bodytext = bodytext + "\nPersonal involucrado: " + "" + ""; bodytext = bodytext + involucrados; bodytext = bodytext + "\n Área funcional: " + area + ""; bodytext = bodytext + "\n Creador del reporte: " + Convert.ToString(Session["userName"]) + ""; bodytext = bodytext + "\n\n Estatus: " + stat.getEstatusDesc(Convert.ToInt32(incid.getStatus(incid_id))) + ""; bodytext = bodytext + "\nPara más información, favor de consultar la siguiente liga. \n http://10.240.151.139/pentagono/incidDetail.aspx?folio=" + incid_id + "\n"; incid.Dispose(); stat.Dispose(); //string to = Convert.ToString(usrInfoTable.Rows[0]["usrInfo_email"]) + ";"; tbl_userInfoTableAdapter usrInfo = new tbl_userInfoTableAdapter(); DataSet1.tbl_userInfoDataTable tblusrInfo = new DataSet1.tbl_userInfoDataTable(); usrInfo.FillByArea(tblusrInfo, areaID); string[] correos; // = {""}; int numCorreos = tblusrInfo.Rows.Count + 1; correos = new string[numCorreos]; correos[0] = Convert.ToString(Session["email"]); for (int j = 1; j <= tblusrInfo.Rows.Count; j++) { correos[j] = Convert.ToString(tblusrInfo.Rows[j - 1]["usrInfo_email"]); } //string[] correos; // = {""}; //correos = new string[2]; ////correos = new string[1]; //correos[0] = Convert.ToString(Session["email"]); //correos[1] = getEmail(getResponsable(Convert.ToInt32(Session["userID"]))); try { lblError.Text = f.enviarCorreoAsync("Fernando Reyes", correos, " ", bodytext, "Reporte incidente/accidente folio " + incid_id); } catch (Exception ex) { lblError.Text = ex.Message; } }