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!

Submit a whole ASP Page via CDONTS

Status
Not open for further replies.

akalana

MIS
Jul 30, 2002
8
0
0
US
I'm have a form that users fill out that brings them to a confirmation page that contains their inputed information.
I am trying to utilize CDONTS to send the whole page that contains their inputed data however, and I need to keep the current state of the page, so not to loose information.
Any ideas?
Here is the code i'm using:
<%
Dim objMail
Set objMail = CreateObject(&quot;CDONTS.Newmail&quot;)
objMail.TO = &quot;someone@someone.com&quot;
objMail.From = &quot;someone@someone.com&quot;
objmail.Subject = &quot;HTML EMAIL!&quot;
objMail.MailFormat = cdoMailFormatMime
objMail.BodyFormat = cdoBodyFormatHTML
objMail.Body = objMail.send
set objMail = Nothing
%>


obviously, the complete.asp page is the page that contains the information the user has entered. Enclosing the link in quotations, produces the text link in the email.
 
You can't refer a page as a body directly.
Request the form fields one by one instead.
Example:

visitor_name = request.form(&quot;full_name&quot;)
comment= request.form(&quot;comment&quot;)

objMail.Body = visitor_name & &quot; has submitted the following comment : &quot; & comment

 
Unfortunately, I have to retain the page without manipulating the look.
(They want the exact look as on the site, via email)
Since this isn't an option, what do you think about saving the page (that contains inputted information) and then sending via CDONTS, the page as an attachment?
 
Simple. Just build the exactly same page in your mail body rather than printing &quot;Visitor has submitted this&quot; in my previous example.
 
Cut and paste the webpage sourcecode as the body of the text. You will likely have to clean up the &quot; in the sourcecode you can use Replace() to do this automatically. You will also have to replace the input values with values gotten from the Request.Form function. (eg. msgBody = &quot; <input type='text' name='Firstname' value='&quot; & Request.Form(&quot;Firstname&quot;) & &quot;'>&quot; ) That should give you the required output.
 
The Request.Form function requires &quot;&quot; quotation marks in order to pull information from the previous page. In placing the quotation marks 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?
Code that returns VB compliation error:
objMail.Body = &quot;<html> Hello, <input TYPE=text NAME='Name' value='&quot; & Request.Form(&quot;Name&quot;) </html>&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top