相关代码如下,只是不知道已发送邮件怎么添加?
NotesDocument doc = ndb.CreateDocument(); doc.AppendItemValue("SendTo", txtReceiver4.Text.Trim()); WriteLog.Log("添加收件人,成功!"); if (txtCC4.Text.Trim() != "") { doc.AppendItemValue("CopyTo", txtCC4.Text.Trim()); WriteLog.Log("添加抄送人,成功!"); } doc.AppendItemValue("Subject", txtSubject4.Text); WriteLog.Log("添加邮件主题,成功!"); doc.AppendItemValue("Form", "Memo"); //发件人信息 doc.AppendItemValue("From", "jack zhang"); string psenddate = System.DateTime.Now.ToString("yyyy/MM/dd"); doc.ReplaceItemValue("SendDate", psenddate); ns.ConvertMime = false; Domino.NotesMIMEEntity bodyHtml = doc.CreateMIMEEntity("Body"); Domino.NotesStream notesStream = ns.CreateStream(); notesStream.WriteText(txtContent4.Text, Domino.EOL_TYPE.EOL_NONE); bodyHtml.SetContentFromText(notesStream, "text/html, charset=UIF-8", Domino.MIME_ENCODING.ENC_IDENTITY_BINARY); notesStream.Truncate(); notesStream.Close(); doc.CloseMIMEEntities(true, "Body"); ns.ConvertMime = true; doc.ComputeWithForm(false, false); object MailTo = txtReceiver4.Text.Trim(); doc.Send(false, ref MailTo); doc = null; MessageBox.Show("发送成功!");
2 回答
郎朗坤
TA贡献1921条经验 获得超9个赞
刚才找到方法了,就是doc.Save(false,false,true);
不过需要注意的是doc.UniversalID要重新赋值,不然保存的时候会报错,各位大侠,有没有要补充的呢?
- 2 回答
- 0 关注
- 242 浏览
添加回答
举报
0/150
提交
取消