用户创建新电子邮件,然后单击“发送”按钮,邮件丢失,并且附加组件使用相同的TO
,CC
,BCC
,subject
创建新电子邮件, Attachment
和HTMLBody
。
和HTMLBody将通过一些文本进行修改。
我的问题是如何从用户的新电子邮件中访问所有值。
public void SendNewEmail( object Item, ref bool Cancel)
{
Outlook.MailItem newMailItem = Application.CreateItem(Outlook.OlItemType.olMailItem);
newMailItem.To = ;
newMailItem.Subject = ;
newMailItem.Attachment = ;
newMailItem.HTMLBody = ;
newMailItem.Send();
}
更新我
对吗?
public void SendNewEmail(object Item, MailSendType SendType)
{
Outlook.MailItem newMailItem = Application.CreateItem(Outlook.OlItemType.olMailItem);
Outlook.MailItem mItem = Item as Outlook.MailItem;
newMailItem.To = mItem.To;
newMailItem.Subject = mItem.Subject;
newMailItem.HTMLBody = mItem.HTMLBody;
newMailItem.Send();
}
private void Application_ItemSend(object Item, ref bool Cancel)
{
SendNewEmail(Item, MailSendType.Normal);
}