//--------A008-------- private void SendviaMail_Click(object sender, EventArgs e) { StringBuilder mailBody = new StringBuilder(); mailBody.Append("<table style='width: 35%;'>"); foreach (DataGridViewColumn column in dataGridConnections.Columns) { mailBody.AppendFormat("<th>" + column.HeaderText + "</th>"); } foreach (DataGridViewRow row in dataGridConnections.Rows) { mailBody.Append("<tr>"); foreach (DataGridViewCell cell in row.Cells) { mailBody.AppendFormat("<td>" + cell.Value + "</td>"); } mailBody.Append("</tr>"); } mailBody.Append("</table>"); frmSendMail SendMailForm = new frmSendMail(mailBody.ToString()); SendMailForm.ShowDialog(); }
private void btnEmail_Click(object sender, EventArgs e) { try { string tempPath = string.Format("{0}{1}", AppCommon.GetDefaultStorageFolderPath(), "Temp"); if (!System.IO.Directory.Exists(tempPath)) { System.IO.Directory.CreateDirectory(tempPath); } string newfileName = string.Format("{0}\\{1}{2}", tempPath, FileTitle, Path.GetExtension(this.FileName)); File.Copy(this.FileName, newfileName, true); frmSendMail frm = new frmSendMail(); frm.AttachedFiles.Add(this.FileTitle, newfileName); frm.SOURCE_ENTITY = this.EntityType; frm.SOURCE_ENTITY_ID = this.EntityID; if (frm.ShowDialog() == DialogResult.OK) { // MAINTAINING HISTORY OF EMAIL SENT TBL_MP_CRM_SM_DocumentHistory history = new TBL_MP_CRM_SM_DocumentHistory(); history.AttachmentID = this.AttachmentID; history.EntityType = (int)this.EntityType; history.EmployeeID = Program.CURR_USER.EmployeeID; history.CreateDatetime = AppCommon.GetServerDateTime(); history.Description = string.Format("{0} sent Email Atachment\nTO: {1} dt. {2}\nSUB: {3}\n\n{4}", Program.CURR_USER.UserFullName, frm.txtMailTo.Text, history.CreateDatetime, frm.txtSubject.Text, frm.txtMessage.Text); _UOM.AppDBContext.TBL_MP_CRM_SM_DocumentHistory.Add(history); _UOM.AppDBContext.SaveChanges(); PopulateHistory(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnMail_Click(object sender, EventArgs e) { frmSendMail emailSend = new frmSendMail(_profesor); emailSend.ShowDialog(); }