0
我参加了一个简单的形式从网并把它放在一个网站,作为一个接触的形式使用,ALLS很好,它看起来还好,但是当我提交表单,我得到这个错误。 服务器对象错误ASP 0177:800401f3'ASP联系表格服务器对象错误ASP 0177:800401f3'
Server.CreateObject失败
/new/contactusprocess.asp,线31
800401f3
这是代码
<%
Dim error
error = 0
For Each f In Request.Form
If Request.Form(f) = "" Then
error = 1
End If
Next
If error=1 Then
response.redirect "error.html"
Else
Dim f, emsg, mail_to, r, o, c, other
fline = "_______________________________________________________________________"& vbNewLine
hline = vbNewLine & "_____________________________________"& vbNewLine
emsg = ""
For Each f In Request.Form
If mid(f,1,1)<>"S" = True Then 'do not save if input name starts with S
emsg = emsg & f & " = " & Trim(Request.Form(f)) & hline
End If
Next
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.From = Request("Email Address")
objNewMail.Subject = "Message from contact page (version: 1.0)"
objNewMail.To = mail_to
objNewMail.Body = emsg & fline
objNewMail.Send
Set objNewMail = Nothing
response.redirect "thankyou.html"
End if
%>
在此先感谢
您好,谢谢,这是非常不同的,我的asp,我应该包含什么html在这里,以显示窗体?我的html不适合您的更改,感谢您的帮助 – Sarah
@Sarah:这里没有涉及HTML;我已经重构了答案,以帮助您粘贴到代码中。你必须确保它适合你的应用程序。这意味着替换您的非工作的基于CDONTS的代码。 –
为了完整的答案,值得一提的是CDONTS最后被包含在Windows 2000中,所以OP的主机在这里没有包含/支持它的问题。 –