When I try to process the below script I get the HTTP 500 Servre Error. Can you take a look at my code and tell me why my form is not processing? I'm new to this asp jmail thing.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@LANGUAGE = VBSCRIPT%> <html>
<body>
<%
'set Variables
Dim Subject
Dim SenderEmail
Dim Recipient
Subject = "This is my form info to you"
SenderEmail = "form@domain.com"
Recipient = "me@mydomain.com"
' Get the form data
Name = Request.Form("Name")
Address = Request.Form("Address")
City = Request.Form("City")
State = Request.Form("Sate")
Zip = Request.Form("Zip")
Email = Request.Form("Email")
Phone = Request.Form("Phone")
Have You Had Surgery = Request.Form("Have You Had Surgery")
'create the body case information to be emailed
Select Case ucase(Subject)
case "Newsletter"
"Name: " & Name & vbCrLf &_
"Address: " & Address & vbCrLf &_
"City: " & City & vbCrLf &_
"State: " & State & vbCrLf &_
"Zip: " & Zip & vbCrLf &_
"Email: " & Email & vbCrLf &_
"Have You Had Surgery: " & Have You Had Surgery & vbCrLf &_
end Select
' Create the JMail message Object
set msg = Server.CreateOBject( "JMail.Message" )
' Set logging to true to ease any potential debugging
' And set silent to true as we wish to handle our errors ourself
msg.Logging = true
msg.silent = true
' Enter the sender data
msg.From = SenderEmail
' Note that as addRecipient is method and not
' a property, we do not use an equals ( = ) sign
msg.AddRecipient Recipient
' The subject of the message
msg.Subject = Subject
' And the body
msg.body = Newsletter
"Name: " & Name & vbCrLf &_
"Address: " & Address & vbCrLf &_
"City: " & City & vbCrLf &_
"State: " & State & vbCrLf &_
"Zip: " & Zip & vbCrLf &_
"Email: " & Email & vbCrLf &_
"Phone: " & Phone & vbCrLf &_
"Have You Had Weight Loss Surgery: " & Have You Had Weight Loss Surgery & vbCrLf &_
' Now send the message, using the indicated mailserver
if not msg.Send("mail.mydomain.com" ) then
Response.write "<pre>" & msg.log & "</pre>"
else
Response.write "Message sent succesfully!"
end if
' And we're done! the message has been sent.
%>
</body>
</html>
|