Click to See Complete Forum and Search --> : Syntax Error 800a03ea


TehLibrarian
04-11-2007, 04:18 PM
I'm getting a

Microsoft VBScript compilation error '800a03ea'

Syntax error

/form_response.asp, line 40

MSG = "mail was not sent successfully"<br>
------------------------------------------^

error with my form. My ASP knowledge is extremely basic and I think I might be missing punctuation somewhere. Any help would be greatly appreciated. Heres the code:

<%
my_from=request("mail-fromName")
my_fromAddress=request("mail-fromaddress")
my_to=request("mail-toName")
my_toAddress=request("mail-toaddress")
my_subject=request("mail-subject")
my_relay=request("mail-relay")

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.RemoteHost = my_relay
Mailer.FromName = my_from
Mailer.FromAddress = my_fromAddress
Mailer.AddRecipient my_to, my_toaddress
Mailer.Subject = my_subject

sBodyText = "The following is feedback from my web site." & vbcrlf & vbcrlf
sBodyText = sBodyText & "First Name: " & Request.Form("firstname") & vbCrLf
sBodyText = sBodyText & "Last Name: " & Request.Form("lastname") & vbCrLf
sBodyText = sBodyText & "Company: " & Request.Form("company") & vbCrLf
sBodyText = sBodyText & "E-Mail Address: " & Request.Form("email")
sBodyText = sBodyText & vbCrLf & Chr(13) & Chr(10) & Chr(13) & Chr(10)
sBodyText = sBodyText & "" & Request.Form("feedback") & vbCrLf
sBodyText = sBodyText & "" & Request.Form("comment") & vbCrLf

Mailer.BodyText = sBodyText

If Mailer.SendMail then
Msg = "Thank you for your enquiry.<br> A member of staff will contact you shortly."
Else
MSG = "mail was not sent successfully"<br>
MSG = MS G& mailer.response & "<br>"
End If

response.write MSG
%>

gil davis
04-11-2007, 06:40 PM
Either your post was mangled by the parser, or I don't understand what you wanted to do. But I believe that what you wanted is this:
If Mailer.SendMail then
Msg = "Thank you for your enquiry.<br> A member of staff will contact you shortly."
Else
Msg = "Mail was not sent successfully" & Mailer.response & "<br>"
End If

TehLibrarian
04-12-2007, 11:17 AM
Thank you. I'll give that a try.