【问题标题】:Forward RDOMail from original mail address by using Outlook Redemption使用 Outlook Redemption 从原始邮件地址转发 RDOMail
【发布时间】:2013-05-17 22:39:28
【问题描述】:

我目前正在开发一个自动处理邮箱邮件的应用程序。我们使用工具 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”的邮件地址?

提前致谢!!

【问题讨论】:

    标签: c# .net exchange-server mapi outlook-redemption


    【解决方案1】:

    问题在于被转发的邮件是在配置文件的主存储中创建的,而不是在代理邮箱中创建的。

    除了设置 Sender 属性之外,您是否尝试过设置 SentOnBehalfOf 属性?

    【讨论】:

    • 感谢您的回复!我已经尝试设置该属性,但在这种情况下,似乎根本没有发送消息......没有任何错误。有什么方法可以在共享存储中创建转发的消息?谢谢!!
    • 您可以保存 Forward() 返回的 RDOMail 对象,然后将其移动到共享邮箱(RDOMail.Move - 请记住 Move() 返回您必须使用的 RDOMail 对象的新实例) .
    猜你喜欢
    • 2014-10-16
    • 2023-03-29
    • 2019-03-12
    • 2015-05-18
    • 1970-01-01
    • 2014-08-03
    • 1970-01-01
    • 2016-05-22
    • 2014-02-14
    相关资源
    最近更新 更多