1

WEB 环境 IIS 7.5、Windows 2008 R2、经典 ASP

因此,每隔几天或几周(完全随机),我们的一个网络服务器将停止发送电子邮件并报告错误代码“80040211”,这是一个通用的“无法发送电子邮件”消息。我正在使用“CDO.Message”对象来处理发送邮件,并且邮件正在单独的内部 SMTP 服务器上发送。一旦发生错误,我重新启动该服务器上的“打印后台处理程序”服务,它可以立即发送邮件。

这发生在我们的生产和开发服务器上。所有服务器都运行 IIS 7.5、Windows 2008 R2,我们使用 Classic ASP。

有谁知道为什么 Printer Spooler 服务会停止发送电子邮件?一旦重新启动,电子邮件又可以工作了吗?

更新:这是我正在使用的代码,以防有人想要它作为参考:

SET mail = Server.CreateObject("CDO.Message")

mail.To         = "myWorkEmail@myjob.com"
mail.From       = "myWorkEmail@myjob.com"
mail.Subject    = "Test subject"
mail.HTMLBody   = "Test email"



mail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
mail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp" 'this is the name of the SMTP server, its name is literally "smtp"
mail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25 
mail.Configuration.Fields.Update
ON ERROR RESUME NEXT
mail.Send
ON ERROR GOTO 0

SET mail = NOTHING
4

0 回答 0