我有一个功能,当邮件到达接收者时,使用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服务器上工作得很好,但是当在生产服务器和另一个邮件服务器上使用时,没有收到递送回执。
我相信在我的邮件服务器和生产邮件服务器之间一定有什么不同,但我不知道它到底是什么。
所以,如果有人以前遇到过这样的问题,请告诉我该怎么做。
发布于 2010-03-31 20:58:42
它在你的本地机器上工作几乎是偶然的,因为你正在把它传递给你自己。通过指定sendUsingPort在世界上计算中继的you have to explicitly tell CDO not to deliver to the local smtp
conf.Fields"ttp://schemas.microsoft.com/cdo/configuration/sendusing".Value = 2
https://stackoverflow.com/questions/2552796
复制相似问题