Reply
JMail problems
Old 12-13-2006, 09:16 AM JMail problems
blelisa's Avatar
Experienced Talker

Posts: 45
Location: Western New York
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
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!
blelisa is offline
Reply With Quote
View Public Profile Visit blelisa's homepage!
 
When You Register, These Ads Go Away!
Old 12-13-2006, 04:50 PM Re: JMail problems
chrishirst's Avatar
Super Moderator

Posts: 13,576
Location: Blackpool. UK
MyMail.Body = "Request.Form("UserName")
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-20-2006, 12:13 PM Re: JMail problems
Average Talker

Posts: 22
Name: Ophir
Location: Israel
change line 29 to:

MyMail.Body = Request.Form("UserName") & "Thanks for signing up for our new online service!"
ophir.oren is offline
Reply With Quote
View Public Profile Visit ophir.oren's homepage!
 
Reply     « Reply to JMail problems
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12807 seconds with 12 queries