0

我正在使用以下方法回复进入业务功能邮箱的邮件。

添加的正文只是间歇性地设置。仅当有人通过电子邮件取消订阅邮件但在数据库中未找到发件人(或正文中)的电子邮件地址并且我们希望他们向我们发送他们想要的邮件地址时,才会调用此方法退订。

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();

            RDOAddressEntry optingout = session.AddressBook.GAL.ResolveName("optingout");
            //reply.Sender = optingout; this had no effect
            reply.SentOnBehalfOf = optingout;
            reply.Subject = "Automated Response - Could not complete unsubscribe";
            reply.Body = "This is an automated response from the Newsletter unsubscribe system. We couldn't find "+item.Sender+" in our database to unsubscribe you from our mailings.\r\n\r\nPlease reply to this mail and include the email address you want to unsubscribe.\r\n\r\nKind Regards\r\n.";
            reply.Send();

            session.Logoff();
        }
4

2 回答 2

0

首先,如果您已经使用 OOM,则没有理由调用 RDOSession.Logon。您可以简单地使用 MAPIOBJECT 属性:将行 session.Logon() 替换为 session.MAPIOBJECT = item.Application.Session.MAPIOBJECT 不要调用注销。

其次,你的意思是消息是在没有正文的情况下收到的吗?您在“已发送邮件”文件夹中看到空的 bofy 吗?

于 2010-02-16T19:14:38.640 回答
0

我不得不编辑thingie.HTMLBody 和thingie.Body。

我想我本可以弄清楚如何判断何时设置每个值的值,但因为我只是想确保在这种情况下我可以控制身体,所以我只是设置两者。

于 2010-03-23T08:15:09.460 回答