Click to See Complete Forum and Search --> : More JMail problems


Blelisa
12-13-2006, 09:13 AM
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!

so_is_this
12-13-2006, 09:24 AM
Proper syntax is all that is required:

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

Blelisa
12-13-2006, 09:28 AM
Thank you for your help