使用兑换作为其他用户发送

发布于 2024-08-21 11:14:13 字数 1875 浏览 12 评论 0原文

当我查看 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 = "[email protected]";
    reply.Send();
    session.Logoff();
}

邮件发送正常,但已发送来自我的地址,而不是来自 [email protected]

我使用:

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 = "[email protected]";
    reply.Send();
    session.Logoff();
}

如果 出现异常,提示邮件配置文件未配置

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

提前非常感谢...

When I view outlook I see my mailbox but also additional "business function" mailboxes. One of these is "optingout"

I've written a console app that loops through several of these function mailboxes (by enumerating the folders in my session) and grabs all of the mails so I can then loop through them and take actions depending on the mailbox, subject and body.

In one case I need to reply to an email to say that they have asked to unsubscribe but I can't find the email they've used (or supplied in the body) in our database and can they respond with the correct mail... this tends to be where people have mail forwarding and have forgotten (and we get a ridiculous amount of these!)

In the below code OutlookItem is a custom class not a redemption or outlook class

When I used:

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 = "[email protected]";
    reply.Send();
    session.Logoff();
}

the mail sends fine but is sent from my address and not from [email protected]

if I use:

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 = "[email protected]";
    reply.Send();
    session.Logoff();
}

It throws an exception saying that the mail profile isn't configured

So how do I use redemption to reply to a message and control the sending address?

Many thanks in advance...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱情眠于流年 2024-08-28 11:14:13

与消息发送者相对应的 RDOMail 属性称为 SentOnBehalfOf*。如果可以,请通过 EntryID(即 SentOnBehalfOfEntryID)进行设置,或通过将相应的 RDOAddressEntry 对象直接分配给 SentOnBehalfOf 属性来设置。仅设置 SentOnBehalfOfName 属性会带来名称歧义的风险。

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

The RDOMail-properties corresponding to the sender of a message are called SentOnBehalfOf*. If you can, set it by EntryID (i.e. SentOnBehalfOfEntryID) or by assigning the corresponding RDOAddressEntry object directly to the SentOnBehalfOf-property. Setting only the SentOnBehalfOfName-property runs the risk of name ambiguity.

Setting this requires that the account you use to log on to the Exchange store has "Send As" permissions for the adressbook entry that the message should be sent on behalf of.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文