从表单发送此信息时,我正在尝试调试此问题,但我不断收到此错误。
error '8004020e'
/contacthandler.asp, line 45
我在asp中没有做太多工作,但我已经设法从以前的开发人员那里清理了一点这个文件(仍然有错误)。错误发生在.Send
..forgot 澄清这一点。
这是代码。任何帮助表示赞赏。
'declare variables
dim name, phone, email, comment, service, returnPage
'set variables to the corresponding fields from contact form
name = request.form("custName")
phone = request.form("custPhone")
email = request.form("custEmail")
comment = request.form("custNotes")
service = request.form("service")
returnPage = request.form("page")
dim theEmail
' set the email content data
theEmail = "<h3>Contact from website, information below.</h3><table border='0'><tr><th>Customer Name:<td>"&name
theEmail = theEmail&"<tr><th>Phone Number:<td>"&phone&"<tr><th>Email Address:<td>"&email&"<tr><th>Service Category:<td>"&service
theEmail = theEmail&"<tr><th valign='top'>Comments/Notes:<td>"&comment&"</table>"
' send the email
dim sch
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
.Item(sch & "smtpserverport") = 587
.Item(sch & "smtpserver") = "smtp.office365.com"
.Item(sch & "smtpauthenticate") = 1
.Item(sch & "sendusername") = "########"
.Item(sch & "sendpassword") = "########"
.update
End With
Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = name & "<" & email & ">"
.To = "info@mywebsite.com"
.Subject = "Website - "&service&" Request"
.HTMLBody = theEmail
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing
'response.write "sent, check the mail"
response.redirect "thankyou.asp"
'returnPage&".asp"