代码之家  ›  专栏  ›  技术社区  ›  Paul D'Ambra

使用redemption回复邮件只是间歇性地设置正文文本

  •  0
  • Paul D'Ambra  · 技术社区  · 16 年前

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

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

    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();
            }
    
    2 回复  |  直到 16 年前
        1
  •  0
  •   user269730    16 年前

    首先,如果您已经在使用OOM,则没有理由调用rdosession.logon。您可以简单地存储MapiObject属性: 将line session.logon()替换为 session.mapiObject=item.application.session.mapiObject 做 调用注销。

    第二,友梅安收到的信息是不是有一个身体?在“已发送邮件”文件夹中是否看到空的bofy?

        2
  •  0
  •   Paul D'Ambra    16 年前

    我必须编辑thingie.htmlbody和thingie.body。

    我想我已经知道了如何判断何时设置每一个的值,但是因为我只是想确定在这种情况下我可以控制身体,所以我只是设置了两者。