【问题标题】:Using Redemption to send as another user使用 Redemption 以其他用户身份发送
【发布时间】:2011-01-16 02:34:02
【问题描述】:

当我查看 Outlook 时,我会看到我的邮箱,但还会看到其他“业务功能”邮箱。其中之一是“选择退出”

我编写了一个控制台应用程序,它循环遍历其中几个函数邮箱(通过枚举会话中的文件夹)并抓取所有邮件,这样我就可以遍历它们并根据邮箱、主题和身体。

在一种情况下,我需要回复一封电子邮件,说明他们已要求退订,但我在我们的数据库中找不到他们使用(或在正文中提供)的电子邮件,他们能否回复正确邮件......这往往是人们进行邮件转发并忘记的地方(我们收到的这些邮件数量非常可笑!)

在下面的代码中,OutlookItem 是一个自定义类,而不是兑换或 Outlook 类

当我使用时:

private void replyToMail(OutlookItem item)
{
    RDOSession session = new RDOSession();
    session.Logon(null, null, null, true, null, null);
    RDOMail thisItem = session.GetMessageFromID(item.EntryID, item.StoreID, null);
    RDOMail reply = thisItem.Reply();
    reply.Subject = "Automated Response - Could not complete unsubscribe";
    reply.Body = "This is an automated response ...";
    reply.BCC = "test@our-domain.co.uk";
    reply.Send();
    session.Logoff();
}

邮件发送正常,但从我的地址发送,而不是从 optingout@our-domain.co.uk

如果我使用:

private void replyToMail(OutlookItem item)
{
    RDOSessionClass session = new RDOSessionClass();
    session.LogonExchangeMailbox("optingout", "big.ol.mailserver");
    RDOMail thisItem = session.GetMessageFromID(item.EntryID, item.StoreID, null);
    RDOMail reply = thisItem.Reply();
    reply.Subject = "Automated Response - Could not complete unsubscribe";
    reply.Body = "This is an automated response ...";
    reply.BCC = "test@our-domain.co.uk";
    reply.Send();
    session.Logoff();
}

它抛出一个异常,说明邮件配置文件未配置

那么如何使用兑换来回复消息并控制发送地址?

提前非常感谢...

【问题讨论】:

    标签: send exchange-server-2007 outlook-redemption send-on-behalf-of


    【解决方案1】:

    与消息发送者对应的RDOMail-属性称为SentOnBehalfOf*。如果可以,请通过 EntryID(即SentOnBehalfOfEntryID)或通过将相应的RDOAddressEntry 对象直接分配给SentOnBehalfOf 属性来设置它。仅设置 SentOnBehalfOfName-property 存在名称模糊的风险。

    设置此项要求您用于登录 Exchange 存储的帐户对应代表其发送邮件的地址簿条目具有“发送为”权限。

    【讨论】:

    • 太棒了……虽然身体只是间歇性地设置,但我想我可以单独发布一下……
    猜你喜欢
    • 1970-01-01
    • 2021-05-07
    • 1970-01-01
    • 2013-02-07
    • 1970-01-01
    • 2019-04-06
    • 2018-01-24
    • 2012-01-17
    • 1970-01-01
    相关资源
    最近更新 更多