The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Need fresh eyes for fixing this code, please take a look, Im working on a warranty report form for a company, it looks as if it
Ougan
post Jun 20 2012, 09:16 AM
Post #1





Group: Members
Posts: 3
Joined: 11-June 12
Member No.: 17,252



Ive made a simple web page and an ASP file to have the form post to an email, for some reason all im getting when i hit submit is a 500 error, I have no clue why, If somone could please take a look at this it would help me out, the code for the ASP is below, the HTML form is attached


<%
'Sends an email
Dim mail
dim date
dim homeOwner
dim community
dim lotNum
dim closeDate
dim streetNum
dim phoneNum
dim altNum
dim subWork
dim subFax
dim vendorNum
dim apptDate
dim itemDesc
dim subConBackCharge
dim csr
dim warMgr
dim csrCon

date = Request.Form("date")

homeOwner = Request.Form("homeOwner")

community = Request.Form("community")

lotNum = Request.Form("Lot")

closeDate = Request.Form("closeDate")

streetNum = Request.Form("streetNumber")

phoneNum = Request.Form("homePhone")

altNum = Request.Form("altPhone")

subWork = Request.Form("subWork")

subFax = Request.Form("subNum")

vendorNum = Request.Form("vendNum")

apptDate = Request.Form("aptDate")

itemDesc = Request.Form("itemDesc")

subConBackCharge = Request.Form("subConBackCharge")

csr = Request.Form("csr")

warMgr = Request.Form("warMgr")

csrCon = Request.Form("csrCon")




response = "(COMPANY NAME), INC. " & vbcrlf
response = response & "WARRANTY WORK ORDER FORM " & vbcrlf


'Shortages Write Section

If date <> "" then
response = response & "Date - " & date & vbcrlf
end if

If homeOwner <> "" then
response = response & "Home Owner - " & homeOwner & vbcrlf
end if

If community <> "" then
response = response & "Community - " & community & vbcrlf
end if
If lotNum <> "" then
response = response & "Lot # - " & lotNum & vbcrlf
end if

If closeDate <> "" then
response = response & "Closing Date - " & closeDate & vbcrlf
end if

If streetNum <> "" then
response = response & "Address - " & streetNum & vbcrlf
end if

If phoneNum <> "" then
response = response & "Home Phone# - " & phoneNum & vbcrlf
end if

If altNum <> "" then
response = response & "Alt Phone# - " & altNum & vbcrlf
end if

If subWork <> "" then
response = response & "Subcontractor Correcting Work - " & subWork & vbcrlf
end if

If vendorNum <> "" then
response = response & "Vendor# - " & vendorNum & vbcrlf
end if

If apptDate <> "" then
response = response & "Date of Appointment - " & apptDate & vbcrlf
end if

If itemDesc <> "" then
response = response & "Description Of Items to be corrected - "& vbcrlf & itemDesc & vbcrlf
end if

If subConBackCharge <> "" then
response = response & "Subcontractor to be back charged (if any) - " & vbcrlf & subConBackCharge & vbcrlf
end if

If response <> "" then
response = response & "If the subcontractor cannot make a scheduled appointment they must notify the warranty technician listed below at least 24 hours in advance in order to advise the homeowner. If the subcontractor is a no-show, or fails to notify, a back-charge will automatically be issued to them. Missed appointments without notification are not acceptable. Customer Service is the number one priority at (company name)." & vbcrlf
end if



If csr <> "" then
response = response & "Date of Appointment - " & csr &vbcrlf
end if

If warMgr <> "" then
response = response & "Warranty Manager - "& warMgr & vbcrlf
end if

If csrCon <> "" then
response = response & "CSR Contact Information - " & csrCon & vbcrlf
end if



Set mail = Server.CreateObject("CDO.Message")
mail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

mail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.(company name).net"


mail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

mail.Configuration.Fields.Update

'==End remote SMTP server configuration section==




mail.To = Request.Form("toEmail")
mail.cc = Request.Form("fromEmail")
mail.From = Request.Form("fromEmail")
mail.Subject = "Warranty Work Order Form"

mail.TextBody = response

mail.Send()
Response.Write("Mail Sent")
'Destroy the mail object!
Set mail = nothing
%>


for the sake of privacy Ive replaced the references to the company name with "(company name)" such as in the mail server


Attached File(s)
Attached File  WarrantyFormEDIT.HTML ( 4.38k ) Number of downloads: 90
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Jun 20 2012, 10:43 AM
Post #2


Jocular coder
********

Group: Members
Posts: 2,212
Joined: 31-August 06
Member No.: 43



I don't speak ASP, but it's the usual answer. You do not need "eyes", you need debugging. What values are being returned here and there. Add 'echo' (in ASP) statements to check what is going on.



--------------------
Brian Chandler
Nothing in this post constitutes "commercial solicitation". PayPal does not solicit residents of Japan. Contents may settle in transit. "Legal mind" may or may not be brain-damaged.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Jun 21 2012, 10:10 AM
Post #3


WDG Member
********

Group: Root Admin
Posts: 7,987
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



Also, what messages appear in the server logs?


--------------------
Darin McGrew
WDG Member since 1998
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th April 2014 - 01:40 AM