在我的应用程序中,我在以下行得到一个错误:
'create NewMail object'
Line 96: Function SendHTMLEMail (strFrom, strTo, strCC, strSubject, strBodyHTML)
Line 97: Set objNewMail = Server.CreateObject("CDONTS.NewMail")错误是:
Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid class string
/Utils.inc, line 97我已经将interop.CDONTS.dll添加到应用程序的引用中,但仍然收到相同的错误。
我不确定这个功能是否在任何其他页面中使用,并且正在工作。
我使用的是.NET 2003 Framework1.1,服务器运行的是Windows Server2003
发布于 2010-09-16 19:20:39
我找到解决方案了。我添加了一个新的CDONTS.dll,并使用
regsvr32 C:\SYSROOT\system32\cdonts.dll
这就解决了问题。不需要将其添加到参考文献中。
发布于 2010-09-16 18:56:14
ASP-经典的
由于Win2000和更新版本已停止使用CDONTS,因此您应该使用switch to CDOSYS。
用于通过远程服务器发送的示例代码
Set oMessage = CreateObject("CDO.Message")
Set oConfig = CreateObject("CDO.Configuration")
Set oFields = oConfig.Fields
With oFields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.acme.com"
.Update
End With
With oMessage
Set .Configuration = oConfig
.To = "recipient@acme.com"
.From = "sender@acme.com"
.Subject = "A Subject Line"
.TextBody = "A Text body message"
.Fields.Update
.Send
End With链接的网站提供了各种场景的详细示例。
ASP.NET
如果你的目标是ASP.NET,你应该使用System.Net.Mail而不是CDO
https://stackoverflow.com/questions/3724973
复制相似问题