Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 22nd, 2003, 04:14 PM
Registered User
 
Join Date: Jul 2003
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Build HTML email from form

I have a number of sites that have HTML forms that pass data that is then processed by ASP to send text based emails. This works fine

I now wish to use the same forms, but now send HTML email, formatted using the input HTML form. I can write the script manually to read my forms and generate my emails. I find this time consuming and a pain in the behind as some of my forms are rather long. Has anyone found an easy way or a tool that will take an HTML form and quickly generate the body of my email for my ASP code, with colours, formatting and data?

 
Old July 22nd, 2003, 04:59 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

I am not aware of any tools that do that automatically, but writing a generic engine that does this for you shouldn't be too hard.

If you stick to a strict naming scheme, it's quite easy to use a loop that iterates through the Request.Form collection, extracting the form's fields, applies some formatting and then generates an e-mail. You could even include some hidden fields that determine layout, addressees, etc on a form to from basis.

If you want / need some specific help with this, please post a message here.

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old July 22nd, 2003, 09:47 PM
Friend of Wrox
Points: 2,376, Level: 20
Points: 2,376, Level: 20 Points: 2,376, Level: 20 Points: 2,376, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , Australia.
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

jmccann,

You can email the entire page (including the form) using the XMLHTTP object,
and with a little imagination it would not be difficult to extract the form from the page.
By locating the beginning and end of the form with instr()
and use mid() to extract the html.

Have a look at this article from 4Guys from rolla
http://www.4guysfromrolla.com/webtech/110100-1.shtml

Rod



======================================
They say, best men are moulded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================




Similar Threads
Thread Thread Starter Forum Replies Last Post
Retain text in html form asp email b00gieman Classic ASP Basics 0 August 31st, 2007 04:30 AM
HTML in email? larry HTML Code Clinic 2 May 1st, 2007 10:43 PM
ASP: Sending a HTML form to an email address cancer10 Classic ASP Databases 4 February 19th, 2007 05:25 PM
HTML email robertjshillito Beginning PHP 1 March 1st, 2005 06:15 AM
Linking form and a table that are build separately takawera Access VBA 2 October 8th, 2003 10:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.