Forum Moderators: open

Message Too Old, No Replies

JMAil problems

         

Blelisa

2:15 pm on Dec 13, 2006 (gmt 0)

10+ Year Member



I have got my JMail to send me an email. But what I want is to have included in the email some info from the form that was submitted.

Here is my asp code

<%
set connection=Server.CreateObject("ADODB.Connection")
connection.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &_
server.MapPath("data/hemicustreg.mdb")
connection.Open

sql="INSERT INTO [customer] ([cmpname], [address], [city], [state], [zip], [number], [contact], [email], [system], [pwrd], [username])"
sql=sql & "VALUES"
sql=sql & "('" & Request.Form("cmpname") & "',"
sql=sql & "'" & Request.Form("address") & "',"
sql=sql & "'" & Request.Form("city") & "',"
sql=sql & "'" & Request.Form("state") & "',"
sql=sql & "'" & Request.Form("zip") & "',"
sql=sql & "'" & Request.Form("number") & "',"
sql=sql & "'" & Request.Form("contact") & "',"
sql=sql & "'" & Request.Form("email") & "',"
sql=sql & "'" & Request.Form("system") & "',"
sql=sql & "'" & Request.Form("pswd") & "',"
sql=sql & "'" & Request.Form("username") & "')"

connection.Execute(sql)

Dim MyMail
Set MyMail = Server.CreateObject("JMail.SMTPMail")
MyMail.ServerAddress = "mail.hemisphere.net"
MyMail.Sender = "lblendowski@magneforcess.com"
MyMail.AddRecipient "lblendowski@hemisphere.net"
MyMail.Subject = "New Registrant on Hemisphere.net"
MyMail.Body = "Request.Form("UserName")Thanks for signing up for our new online service!"
MyMail.Execute
Set myMail=nothing
Response.Write("Your e-mail has been sent")

if err<>0 then
Response.Write(Err.Description)
else
response.redirect("tyreg.html")
end if
connection.close

%>

Here is the error I get:
Microsoft VBScript compilation error '800a0401'

Expected end of statement

/hemisphe/prolg.asp, line 29

MyMail.Body = "Request.Form("UserName")Thanks for signing up for our new online service!"
-----------------------------^

Any ideas? Thanks in advance for any help!

Staffa

5:23 pm on Dec 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try this :

MyMail.Body = Request.Form("UserName") & " Thanks for signing up for our new online service!"

[edited by: Staffa at 5:24 pm (utc) on Dec. 13, 2006]