473,324 Members | 2,179 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,324 software developers and data experts.

How Do I send the current form as e-mail

Hi MVPs out there.

I have constructed an order form and the users will enter the informtion. I
now need to send the filled out form as an e-mail (body being the HTML with
the fille din data) to a predefined e-mail address. I know how to use CDO. I
don't want to go to another page to recontruct the HTML as the '.body'
Thank you in anticipation.

Kassam
Jul 22 '05 #1
3 2165
you will need to.... sorry.
I mean you will have to render all the HTML into a string, parsing in your
values from the form, in order to send it.
What you are asking is the equivalent of saying I want to send what I see
through the camera lens, without taking the picture.

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Kassam" <Ka****@discussions.microsoft.com> wrote in message
news:D6**********************************@microsof t.com...
Hi MVPs out there.

I have constructed an order form and the users will enter the informtion.
I
now need to send the filled out form as an e-mail (body being the HTML
with
the fille din data) to a predefined e-mail address. I know how to use CDO.
I
don't want to go to another page to recontruct the HTML as the '.body'
Thank you in anticipation.

Kassam

Jul 22 '05 #2
On Thu, 2 Jun 2005 12:53:18 -0700, Kassam
<Ka****@discussions.microsoft.com> wrote:
Hi MVPs out there.

I have constructed an order form and the users will enter the informtion. I
now need to send the filled out form as an e-mail (body being the HTML with
the fille din data) to a predefined e-mail address. I know how to use CDO. I
don't want to go to another page to recontruct the HTML as the '.body'
Thank you in anticipation.


So don't go to another page, post back to the same page. Construct
the body as you wish, and use variables for the form field values.
Post back to the same form, and fill the values back into the form
from the posted values at the same time as you fill in the body of the
email. Use an If/Then to determine if the page has been posted back,
using a hidden field, and if so, do the CDO bits.

Jeff
Jul 22 '05 #3
"Jeff Cochran" wrote in message
news:42****************@msnews.microsoft.com...
: On Thu, 2 Jun 2005 12:53:18 -0700, Kassam
: <Ka****@discussions.microsoft.com> wrote:
:
: >Hi MVPs out there.
: >
: >I have constructed an order form and the users will enter the informtion.
I
: >now need to send the filled out form as an e-mail (body being the HTML
with
: >the fille din data) to a predefined e-mail address. I know how to use
CDO. I
: >don't want to go to another page to recontruct the HTML as the '.body'
: >Thank you in anticipation.
:
: So don't go to another page, post back to the same page. Construct
: the body as you wish, and use variables for the form field values.
: Post back to the same form, and fill the values back into the form
: from the posted values at the same time as you fill in the body of the
: email. Use an If/Then to determine if the page has been posted back,
: using a hidden field, and if so, do the CDO bits.

To add to what Jeff wrote...

I wrap my HTML in server-side VBScript as one string. Then when I post back
to the same page, the string will be filled in with my input variables and
that is the HTML content I send out with CDOSYS.

I only send the output via mail if the form has been posted. An easy way to
check is to add a name value pair to your submit button.

sub prt(str)
Response.Write str & vbCrLf
end sub

prt "<html>"
prt "<body>"
prt "<form action="""" method=""post"" />"
prt "<input type=""text"" name=""iname"" value="""" /><br />"
' additional form input elements
prt "<input type="submit" name="submit value="Submit" />"
prt "</form>"
prt "</body>"
prt "</html>"

Then put everything in this conditional to see if you post to the screen or
send via mail.

dim s, strName, valid
strName = Server.HTMLEncode(Replace(Request.Form("iname"),"' ","''"))
s = Server.HTMLEncode(Replace(Request.Form("submit")," '","''"))
if s <> "" then
' validate input
if valid then
' mail it
prt "Thank you"
prt "<span style=""cursor: pointer; border: 1px solid black;
background-color: #efe"" onclick=""location.href='/'"">Continue</span>"
Response.End
else
' Post error
' Fall through to display form on screen
end if
end if

None of this is tested for errors/typos.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 22 '05 #4

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

Similar topics

1
by: mhawkins19 | last post by:
I have a form built and on the onclick event I validate all of the fields and then if the form is ok, on the submit event I run a javascript function to set a cookie and download a file from the...
8
by: Zlatko Matiæ | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
1
by: moelleni | last post by:
Hi, I made an Access 2002 Database and wanted to automate it to sent the current record to Word 2002. So readed the article "How to send the current record to Word 2000 with automation" I tried...
3
by: Satish | last post by:
Hi, I am facing problem with, sending data frm mdi child to mdi parent. I have search Dropdown in MDI form, depend on selection, or enter string(its like IE URL functionality) and click...
9
by: eswanson | last post by:
I have a web page I need to post a file plus some other fields to it. How can I do this from a asp.net page. I know I can send individual fields to the other page, but how do I send a file to the...
6
by: paul | last post by:
HI! How do we send a variable from an Iframe page back to its parent? I have a script that calculates the iframe's window size but I need to know how to send that value back to its parent so I...
4
by: Thomas Eichner | last post by:
Hi, does anybody know a public website which offers a service that displays all data send by a browser (or an app calling the website), especially HTTP GET and POST data, browser data etc.? I...
0
by: SushiSean | last post by:
When executing the xmlhttp.send function to request shipper for available shipments (I send xml as string and receive result xml): XMLHTTP xmlhttp = new XMLHTTP(); xmlhttp.open("POST",...
1
by: mrajanikrishna | last post by:
Hello Friends, I am generating two reports but two files. First report is Shipment Booking Form. After generating this form, I want to send to the cargo management by email. As far everything...
4
by: Joseph Geretz | last post by:
We use a Soap Header to pass a token class (m_Token) back and forth with authenticated session information. Given the following implementation for our Logout method, I vastly prefer to simply code...
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
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.