473,325 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

JMAIL HELP

Im trying to take a form - and send it to two places...
I'd like the form data to go to a database as well as email
the form results...

Below is the form handler that I currently use... Is it possible to
do this with what I have?

I really need help here!

thanks....

<%@LANGUAGE = VBSCRIPT%>
<%

' Get the form data
senderEmail = Request.Form("requiredemail")
subject = "Ladera - Contact Us Form"
recipient = "La****@candw.lc"
body = body & "Name: " & Request.Form("requiredname") & vbCrLf
body = body & "Address: " & Request.Form("Address") & vbCrLf
body = body & "City: " & Request.Form("City") & vbCrLf
body = body & "State: " & Request.Form("State") & vbCrLf
body = body & "Zip: " & Request.Form("Zip") & vbCrLf
body = body & "Country: " & Request.Form("Country") & vbCrLf
body = body & "Phone #: " & Request.Form("requiredphone") & vbCrLf
body = body & "Email: " & Request.Form("requiredemail") & vbCrLf
body = body & "Fax #: " & Request.Form("Fax") & vbCrLf
body = body & "Comments: " & Request.Form("Comments") & vbCrLf

Dim lobjMail

Set lobjMail = Server.CreateObject ("JMail.SMTPMail")

' This is my local SMTP server
' lobjMail.ServerAddress = "216.21.17.82"
lobjMail.Sender = senderEmail
lobjMail.AddRecipient recipient
'lobjMail.AddRecipient recipient1 commented out
lobjMail.Body = body
lobjMail.Subject = subject

lobjMail.Execute
SendEmail = True

Set lobjMail = Nothing

Response.Redirect "index.asp"


%>
Jul 19 '05 #1
1 2315
> Im trying to take a form - and send it to two places...
I'd like the form data to go to a database as well as email
the form results...
Sure, what is the problem you're having?
body = body & "Name: " & Request.Form("requiredname") & vbCrLf
body = body & "Address: " & Request.Form("Address") & vbCrLf
body = body & "City: " & Request.Form("City") & vbCrLf
body = body & "State: " & Request.Form("State") & vbCrLf
body = body & "Zip: " & Request.Form("Zip") & vbCrLf
body = body & "Country: " & Request.Form("Country") & vbCrLf
body = body & "Phone #: " & Request.Form("requiredphone") & vbCrLf
body = body & "Email: " & Request.Form("requiredemail") & vbCrLf
body = body & "Fax #: " & Request.Form("Fax") & vbCrLf
body = body & "Comments: " & Request.Form("Comments") & vbCrLf


Okay, so you build up the body here, why can't you also build out a SQL
statement?

sql = "INSERT INTO tableName(columnName, ...) VALUES('" &
replace(request.form("requiredname"), "'", "''") & "', ...")
set conn = CreateObject("ADODB.Connection")
conn.open connectionString ' see http://www.aspfaq.com/2126
conn.execute sql, , 129

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Lasse Edsvik | last post by:
Hello I use this code to send massmail with an attachment using JMail 4 proffessional. and the attachment seems to be attached but when i open it the first time my system32 folder opens..........
2
by: Kingdom | last post by:
I have a SelectBoxes.asp page that is working with multiple selection dropdown boxes to extract data and total the selection prices. Tom & Bob were kind enough to give me a big help getting this...
4
by: Kingdom | last post by:
Having a problem with a jmail email script and cannot seem to solve this error any sugestions welcome. Error shows in browser as Microsoft VBScript runtime error '800a01f4' Variable is...
0
by: BDKiii | last post by:
Ok.. I know this has been covered before -but- here it is again... I installed Jmail to my server and tested it... and it worked fine. I then installed W#.Upload to the same server and tested it to...
2
by: rourou | last post by:
Hello everyone In VB.NET i can use Jmail to send a mai code Dim JMai JMail = Server.CreateObject("JMail.Message" JMail.silent = Tru JMail.Logging = Tru JMail.Charset = "gb2312
8
by: Mangler | last post by:
I am new to Jmail/ASP and either need some help or someone to tell me I am stupid... I got Jmail to work fine. My problem is I need to send an email based on somthing a customer submitted. ...
0
by: johnet | last post by:
Error: jmail.SMTPMail error '8000ffff' Cannot open file L:/ems/mail/hi.html Code: <% DIM strEmail, strFirstName, strLastName, strSubject, strComments, Mailer
0
by: vernon1231 | last post by:
Hi! PLEASE need help! My aim is to make a newsletter, therefor I need a picture to go a long with the mail I am creating from a mailinglist. When I am opening my mail I dont get my picture but a...
4
by: cgrudzinski | last post by:
Hello, I have JMail working without attachments but now want to start using this feature. When using the .addattachment though the email received contains the binary data of the attachment - see...
2
borisding
by: borisding | last post by:
Hi there, I'm using Jmail for sending email with some attachments. Basically, I will need to send out email with the contents in unicode characters such as Simplified Chinese, Japanese etc. I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.