Asp classic 提交表格的问题

Asp classic 提交表格的问题,asp-classic,vbscript,forms,Asp Classic,Vbscript,Forms,我正在尝试使用.Asp提交我的查询表单,但我不断收到服务器错误 希望将捕获的表单详细信息发送到我的电子邮件地址,并与客户确认详细信息 有没有想过为什么它不起作用 更新代码: <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transi

我正在尝试使用.Asp提交我的查询表单,但我不断收到服务器错误

希望将捕获的表单详细信息发送到我的电子邮件地址,并与客户确认详细信息

有没有想过为什么它不起作用

更新代码:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

<%

            'send by connecting to port 25 of the SMTP server'
            Dim iMsg
            Dim iConf
            Dim Flds
            Dim strBody
            Dim strSmartHost

            Const cdoSendUsingPort = 2
                StrSmartHost = "smtp.glimmer-nights.co.uk"

                set iMsg = CreateObject("CDO.Message")
                set iConf = CreateObject("CDO.Configuration")
                set Flds = iConf.Fields

                'Set the CDOSYS configuration fields to use port 25 on the SMTP server'
                With Flds
                    .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
                    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
                    .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
                    .Update
                End With

                'Build Message body'
                strBody = "Fullname: " & Request.form("firstname") & Request.form("Surname") & vbcrlf
                strBody = strBody & "Address: " & Request.form("Address") & vbcrlf
                strBody = strBody & "Postcode: " & Request.form("postcode") & vbcrlf
                strBody = strBody & "Contact No: " & Request.form("tel") & vbcrlf
                strBody = strBody & "Email: " & Request.form("email") & vbcrlf
                strBody = strBody & "How did you hear about us: " & Request.form("where") & vbcrlf
                strBody = strBody & "Function Date: " & Request.form("fday") & Request.form("fmonth") & Request.form("fyear") & vbcrlf
                strBody = strBody & "Venue Name: " & Request.form("vname") & vbcrlf
                strBody = strBody & "Venue Address: " & Request.form("vaddress") & vbcrlf
                strBody = strBody & "Venue Postcode: " & Request.form("vpostcode") & vbcrlf
                strBody = strBody & "Function Type: " & Request.form("ftype") & vbcrlf
                strBody = strBody & "No. Attending: " & Request.form("noattend") & vbcrlf
                strBody = strBody & "Arrive At: " & Request.form("arrive") & vbcrlf
                strBody = strBody & "Guest Arrival: " & Request.form("garrival") & vbcrlf
                strBody = strBody & "Function End: " & Request.form("fend") & vbcrlf
                strBody = strBody & "Additional Information: " & Request.form("additionalInfoTextarea")

                'Apply the settings to the message'
                With iMsg
                Set .Configuration = iConf
                    .To = "info@glimmer-nights.co.uk"
                    .From = "info@glimmer-nights.co.uk"
                    .Subject = "Online Enquiry"
                    .TextBody = strBody
                    .Send
                End With

                Response.Write("<h1>Booking Enquiry Sent!</h1><p>Thank you for submitting your online booking enquiry for DJ's in Telford or Dj's in Shropshire.  We will contact you shortly.<p>")

                'SEND EMAIL TO CUSTOMER'
                'Build Message body'

                strBody = "Hi " & Request.form("firstname") & " " & Request.form("surname") & "," & vbcrlf & vbcrlf

                strBody = strBody & "We have your contact details as follows: " & vbcrlf & vbcrlf
                strBody = strBody & "Fullname: " & Request.form("firstname") & Request.form("Surname") & vbcrlf
                strBody = strBody & "Contact No: " & Request.form("tel") & vbcrlf
                strBody = strBody & "Email: " & Request.form("email") & vbcrlf
                strBody = strBody & "Address: " & Request.form("Address") & vbcrlf
                strBody = strBody & "Postcode: " & Request.form("postcode") & vbcrlf
                strBody = strBody & "Your function details are as follows: " & vbcrlf & vbcrlf
                strBody = strBody & "Function Date: " & Request.form("fday") & Request.form("fmonth") & Request.form("fyear") & vbcrlf
                strBody = strBody & "Venue Name: " & Request.form("vname") & vbcrlf
                strBody = strBody & "Venue Address: " & Request.form("vaddress") & vbcrlf
                strBody = strBody & "Venue Postcode: " & Request.form("vpostcode") & vbcrlf
                strBody = strBody & "Function Type: " & Request.form("ftype") & vbcrlf
                strBody = strBody & "No. Attending: " & Request.form("noattend") & vbcrlf
                strBody = strBody & "Guest Arrival: " & Request.form("garrival") & vbcrlf
                strBody = strBody & "Function End: " & Request.form("fend") & vbcrlf
                strBody = strBody & "Additional Information: " & Request.form("additionalInfoTextarea") & vbcrlf
                strBody = strBody & "Your quotation will be based on the information provided above." & vbcrlf & vbcrlf
                strBody = strBody & "Thank you for your online booking enquiry. We will be in contact with you shortly to confirm availability & prices." & vbcrlf & vbcrlf
                strBody = strBody & "We look forward to speaking to you soon." & vbcrlf & vbcrlf
                strBody = strBody & "DJ Glimmer" & vbcrlf
                strBody = strBody & "Glimmer Nights Entertainment" & vbcrlf
                strBody = strBody & "T: 01952 247207" & vbcrlf
                strBody = strBody & "M: 07772 471449" & vbcrlf & vbcrlf

                'Apply the settings to the message'
                With iMsg
                Set .Configuration = iConf
                    .To = Request.form("email")
                    .From = "info@glimmer-nights.co.uk"
                    .Subject = "Your Entertainment Booking Enquiry"
                    .TextBody = strBody
                    .Send
                End With

                Then 

                'Enquiry Sent - redirect to Home page'
                Response.Redirect("http://www.glimmer-nights.co.uk/index.html")

                End

                'Cleanup of variables'
                Set iMsg = Nothing
                Set iConf = Nothing
                Set Flds = Nothing

%>

</body>
</html>

无标题文件

您有语法错误。有以下代码块:

Then 

'Enquiry Sent - redirect to Home page'
Response.Redirect("http://www.glimmer-nights.co.uk/index.html")

End
这是错误的,我的错误可能是由为您编写代码的程序员留下的。应该是:

'Enquiry Sent - redirect to Home page'
Response.Redirect("http://www.glimmer-nights.co.uk/index.html")

如果仍然不走运,请发布完整的错误消息以及导致错误的原因。

您遇到了什么错误?您是否已将500错误重定向到调试页面?有一件事:可能的输入错误“firsname”:Request.form(“firsname”)嗨,我已更正代码中的一些输入错误。我只是想知道如何将错误重定向到调试页面?我看到字符串
然后
结束
-这是什么意思?老实说,我正在编辑一个朋友为我写的原始表单。你是说它们不是必需的吗?嗨,我已经做了修改,但还是没有运气。我得到的是标准的500服务器错误页面,没有任何错误消息/行详细信息。我是asp新手,你能建议我如何获得这些信息吗?@user2428136使用IE浏览器?转到工具-->Internet选项-->高级并取消选中“显示友好的HTTP错误消息”。现在您有望看到实际的错误消息。