PDA

View Full Version : Asp help with form needed



mikeybright
09 Feb 2011, 08:23 AM
I have to make our company form send using asp 3 and tbh i don't really have a clue...

I have <form method="post" action="formtomail.asp"> on my reservations.html page

The following is the formatomail.asp...

<%
firstname = Request.Form("firstname")
lastname = Request.Form("lastname")
emailaddress = Request.Form("emailaddress")
telephone = Request.Form("telephone")
country = Request.Form("country")
aday = Request.Form("aday")
amonth = Request.Form("amonth")
ayear = Request.Form("ayear")
dday = Request.Form("dday")
dmonth = Request.Form("dmonth")
dyear = Request.Form("dyear")
guests = Request.Form("guests")
comments = Request.Form("comments")

strMsgInfo = strMsgInfo & "Name= " & firstname & "&nbsp;&nbsp;" & lastname & "<br />"
strMsgInfo = strMsgInfo & "Email= " & emailaddress & "<br />"
strMsgInfo = strMsgInfo & "Telephone= " & telephone & "<br />"
strMsgInfo = strMsgInfo & "Country= " & country & "<br />"
strMsgInfo = strMsgInfo & "Arrival Date= " & aday & "&nbsp;&nbsp;" & amonth & "&nbsp;&nbsp;" & ayear &"<br />"
strMsgInfo = strMsgInfo & "Departure Date= " & dday & "&nbsp;&nbsp;" & dmonth & "&nbsp;&nbsp;" & dyear &"<br />"
strMsgInfo = strMsgInfo & "Amount of Guests= " & guests & "<br />"
strMsgInfo = strMsgInfo & "Comments= " & comments & "<br />"

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "firstname"
Mailer.FromAddress = "emailaddress"
Mailer.AddRecipient = "info@xxxxxx.co.za"
Mailer.RemoteHost = "smtp.telkomsa.net"
Mailer.Subject = "Enquiry from Web Page"

Mailer.ContentType = "text/html"
Mailer.BodyText = strMsgInfo

if Mailer.SendMail then
Response.Write "Mail sent..."

else
Response.Write "Mail send failure. Error was " & Mailer.Response

end if
%>

and my error message is...

An error occurred on the server when processing the URL. Please contact the system administrator.

Please can somebody help me? Thank you