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的主機在這裏沒有包含/支持它的問題。 –