代码之家  ›  专栏  ›  技术社区  ›  Mina Wissa

未在CDO中接收传递通知

  •  0
  • Mina Wissa  · 技术社区  · 15 年前

    我有一个功能,使用cdo发送电子邮件,要求在邮件到达收件人时有一个送达收据。

    我使用以下代码:

    CDO.Message msg = new CDO.Message();
    CDO.Configuration conf = new CDO.Configuration();
    
    conf.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"].Value = 1;
    conf.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserver"].Value = txtHost.Text;
    conf.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserverport"].Value = 25;
    conf.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"].Value = txtPass.Text;
    conf.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"].Value = txtUser.Text;
    
    conf.Fields.Update();
    
    msg.Configuration = conf;
    
    msg.To       = txtTo.Text;
    msg.From     = txtFrom.Text;
    msg.Subject  = txtSubject.Text+" " + DateTime.Now;
    msg.HTMLBody = txtBody.Text;
    msg.BodyPart.Charset = "utf-8";
    
    msg.DSNOptions = CdoDSNOptions.cdoDSNSuccessFailOrDelay;
    msg.Fields.Update();
    msg.Send();
    

    现在,这在我的本地计算机和web服务器上运行得很好,但是在生产服务器和另一个邮件服务器中使用时,没有收到传递回执。

    我相信我的邮件服务器和生产邮件服务器之间一定有区别,但我不知道它到底是什么。

    所以,如果以前有人遇到过这样的问题,请告诉我该怎么做。

    1 回复  |  直到 8 年前
        1
  •  0
  •   Guildencrantz    15 年前

    它在你的本地机器上工作几乎是偶然的,因为你要把它交给你自己。在世界上锻炼 you have to explicitly tell CDO not to deliver to the local smtp 通过指定 sendUsingPort

    conf.fields[“ttp://schemas.microsoft.com/cdo/configuration/sendusing”].value=2