有2个Exchange(Office 365)收件箱帐户personal@mail.com和shared@mail.com。
从Outlook 2016撰写新邮件时,我通常可以选择" From"并将其设置为shared@mail.com,收件人将其设置为shared@mail.com。如果我以编程方式执行此操作,它将按照"代表发送",即使" Form"字段填充正确。
但是,如果我以编程方式将其设置为shared@mail.com,然后手动将“发件人邮件”下拉菜单切换到另一个收件箱,然后再次转到shared@mail.com,则电子邮件将作为共享(预期行为)发送。
我不想代表发送!我的代码如下:
// Code modified for brevity
MailItem originalMailItem = OutlookUtils.GetActiveMailItem(explorer);
MailItem replyMailItem = GetReplyTemplate(app, originalMailItem);
AddressList globalAddressList = app.Session.GetGlobalAddressList();
AddressEntry senderAddressEntry = globalAddressList.AddressEntries["Shared"];
replyMailItem.Sender = senderAddressEntry;
replyMailItem.To = originalMailItem.SenderEmailAddress;
replyMailItem.Subject = "RE: " + originalMailItem.Subject;
replyMailItem.HTMLBody = replyMailItem.HTMLBody + originalMailItem.Reply().HTMLBody;
replyMailItem.Display();
如何作为共享帐户发送,而不是代表?