我目前正在更新旧服务器上的许多测试站点,以便在接下来的几个月中旧服务器停止运行时它们不会中断。特别是一个站点的联系表已经损坏。当用户在填写信息后点击提交时,会出现以下错误:
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/contactsubmit.asp, line 79
800401f3
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "Web Visitor"
If request("email") <> "" then
Mailer.replyto = request("email")
Else
Mailer.replyto = "noEmailEntered@domain.com"
End If
Mailer.FromAddress = "my@email.com"
Mailer.RemoteHost = "hostserver"
If TempTest = TRUE then
Else
Mailer.AddRecipient siteOwner, ContactEmail
If ContactCC <> "" then
Mailer.AddCC siteOwner, ContactCC
End If
End If
If DesignerEmail <> "" then
Mailer.AddBCC DesignerEmail, DesignerEmail
End If
Mailer.Subject = siteOwner & " Contact Form"
Mailer.ContentType = "text/html"
Mailer.BodyText = strBody
If Mailer.SendMail then
response.redirect "contact.asp?sent=yes"
Else
response.redirect "contact.asp?sent=no"
End If
有人告诉我 SMTP 不再需要发送电子邮件,所以我尝试将其全部更改为 CDOSYS。但有趣的是,这台服务器上有更多的站点,我使用相同的 SMTP 代码进行了测试。使用 CDOSYS 的更改:
Set Mailer = Server.CreateObject("CDO.Message")
Mailer.From = "Web Visitor <my@email.com>"
If request("email") <> "" then
Mailer.ReplyTo = request("email")
Else
Mailer.ReplyTo = "noEmailEntered@domain.com"
End If
Mailer.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "hostserver"
If TempTest = TRUE then
Else
Mailer.AddRecipient siteOwner, ContactEmail
If ContactCC <> "" then
Mailer.Cc siteOwner, ContactCC
End If
End If
If DesignerEmail <> "" then
Mailer.Bcc DesignerEmail, DesignerEmail
End If
Mailer.Subject = siteOwner & " Contact Form"
Mailer.HTMLBody = strBody
If Mailer.Send then
response.redirect "contact.asp?sent=yes"
Else
response.redirect "contact.asp?sent=no"
End If
但现在我得到这个错误:
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'Mailer.AddRecipient'
/contactsubmit.asp, line 89
我尝试将其更改为Mailer.Add
和更改Mailer.AddAddress
,但没有成功。有谁知道我怎样才能解决这个错误并希望让它工作?我以前从未使用过邮件服务器,所以如果这是一个简单的修复方法,我深表歉意,但我已经搜索了过去 3 个小时,无法找到一个好的替代.AddRecipient
.