public static bool ComposeMessage(MailMessage msg) { MessageFrm dlg = new MessageFrm(); dlg.btnAppend.Visible = true; dlg.btnCancel.Text = "Cancel"; dlg.edtFrom.ReadOnly = false; dlg.edtTo.ReadOnly = false; dlg.edtSubject.ReadOnly = false; dlg.memBody.ReadOnly = false; dlg.edtFrom.Text = "*****@*****.**"; dlg.edtTo.Text = "*****@*****.**"; dlg.edtSubject.Text = "Test Subject"; dlg.memBody.Text = "Test Body"; if (dlg.ShowDialog() == DialogResult.OK) { msg.BuildMessage(dlg.memBody.Text, ""); msg.From.FullAddress = dlg.edtFrom.Text; msg.ToList.EmailAddresses = dlg.edtTo.Text; msg.Subject = dlg.edtSubject.Text; return(true); } return(false); }
public static void ShowMessage(MailMessage msg) { MessageFrm dlg = new MessageFrm(); dlg.btnAppend.Visible = false; dlg.btnCancel.Text = "Close"; dlg.edtFrom.ReadOnly = true; dlg.edtTo.ReadOnly = true; dlg.edtSubject.ReadOnly = true; dlg.memBody.ReadOnly = true; dlg.edtFrom.BackColor = SystemColors.Window; dlg.edtTo.BackColor = SystemColors.Window; dlg.edtSubject.BackColor = SystemColors.Window; dlg.memBody.BackColor = SystemColors.Window; dlg.edtFrom.Text = msg.From.FullAddress; dlg.edtTo.Text = msg.ToList.EmailAddresses; dlg.edtSubject.Text = msg.Subject; dlg.memBody.Lines = msg.MessageText; dlg.ShowDialog(); }