我目前正在开发一个自动处理邮箱邮件的应用程序。我们使用 Outlook Redemption 工具并将一个服务帐户连接到多个 Exchange 邮箱。
案子
我们面临的问题是从原始邮箱转发邮件。假设服务帐户“A”正在处理共享邮箱“B”并正在转发邮件。我希望发件人是“B”的邮件地址,但是当我收到邮件时,“A”的邮件地址显示为发件人。
源代码
// Initialize the session with the service account.
_session = new RDOSession();
_session.LogonExchangeMailbox(configurationSettings.MailAddress, configurationSettings.Url);
// Connect to the target mailbox and retrieve mail message.
RDOStore store = _session.Stores.GetSharedMailbox(targetMailBox);
RDOMail originalMailItem = store.GetMessageFromID(entryId);
// Creates a forwarded version of the mail.
RDOMail forwardMailItem = originalMailItem.Forward();
// Set sender to target mailbox owner.
if (store is RDOExchangeMailboxStore)
{
forwardMailItem.Sender = ((RDOExchangeMailboxStore)store).Owner;
forwardMailItem.SenderEmailAddress = targetMailBox;
}
// Set recipient and send.
forwardMailItem.Recipients.Clear();
forwardMailItem.Recipients.Add(forwardMailAddress);
forwardMailItem.Send();
问题
- 有人对解决方案有线索吗?
- 如果这不起作用,是否可以在“代表”规则中获取“B”的邮件地址?
提前致谢!!