Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I carry values from Form via HTML formatted email using CDONTS?

Status
Not open for further replies.

akalana

MIS
Jul 30, 2002
8
0
0
US
I have this problem when I'm trying to submit a whole html/asp page via email. In order to use CDONTS, I understand, you have to remove quotation marks in the Objmail.Body section that has the HTML code.
However, to retrieve form values, the Request.Form function requires "" quotation marks to pull information from the previous page. When I replace the quotation marks, I create an error when trying to run the page to submit the email.
Is there another way to call values from the previous form without using the quotation marks?
This is the Code that returns VB compliation error:
objMail.Body = &quot;<html> Hello, <input TYPE=text NAME='Name' value= & Request.Form(&quot;Name&quot;) </html>&quot;
 
Do this:

objMail.Body = &quot;<html> Hello, <input TYPE=text NAME='Name' value=&quot; & Request.Form(&quot;Name&quot;) & &quot;></html>&quot;

Choo Khor
choo.khor@intelebill.com
 
I can carry text values with this code, however I cannot carry checkbox values via email. Is this possible?
The email contains the checkboxes, but not the forms inputted value.
The code is:
objmail.Body = &quot;<html><input type=checkbox name=NewNameplate value=&quot; & Request.Form(&quot;NewNameplate&quot;) &&quot;></html>&quot;
 
The problem with that is if you have a group of checkboxes, all of the values will be the same. What you will want to do is to set the values of all your checkboxes exactly like they were set before selection and then buuild the body in steps:
Code:
Dim myBody
myBody = &quot;<html>&quot;
.
.
.
myBody = myBody & <input type=checkbox name=NewNameplate value='whatever'&quot;
If Request.Form(&quot;NewNameplate&quot;) = 'whatever Then myBody = myBody & &quot; checked&quot;
myBody = myBody & &quot;>&quot;
.
.
.

objmail.Body = myBody & &quot;</html>&quot;
Also, if you want to use double quotes inside your string, just use them twice:
myString = &quot;There is a double quote between here&quot;&quot;and here&quot;

using that quote twice is the escape character to make one double quote part of the string there.
-tarwn
------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top