Solved

Build and style an html page (like with an asp) and then assign the resulting value to a Mailer.BodyText attribute

Posted on 2007-04-10
6
215 Views
Last Modified: 2010-04-16
I would like to build an html page (like with an asp) and assign the resulting value to a Mailer.BodyText attribute.  I need access to the Request object and the ability to call javascript and css before assigning the value to Mailer.BodyText.

Something like this would be ideal:

<% Mailer.BodyText = %><!--#include file="request-response.asp" -->

It would allow me to build and style the page and push the result into the BodyText attribute.

Any ideas on how to do this?

Thanks,
Robert
0
Comment
Question by:neudeal
  • 2
6 Comments
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 250 total points
Comment Utility
It is better if you create a variable in the include file and then use it for the Mailer.BodyText.  In other words your include file would have lines like ...

strBody="This is the body"
strBody=strBody & "This is the last line"

Then the main ASP page would have the line to include the file before the Mailer object is made.  The line for the body would be something like ...

Mailer.BodyText = strBody

That is the basic idea.  I am a little uncertain about what you mean or want to do with Javascript and CSS in this though.  If you have problems it may be in that part of this process.  If you want to clarify that then I can try to give you an idea of it will work or let you know of problems.  This will at least let you know how to use an include and its information.

Let me know if you have a question or need more info.

bol
0
 

Author Comment

by:neudeal
Comment Utility
I am trying to construct a html email response to a form that gets filled out.  I need access to the Request object to embed/echo the submitted values back in this 'confirmation' email.  I also need to execute a query to retrieve additional information to embed in the html.  And I'd like to style the resulting html with a stylesheet.  Is that possible?

~Robert
0
 
LVL 54

Expert Comment

by:b0lsc0tt
Comment Utility
Yes and the include file isn't necessary for any of those steps.  In fact, if the message body is being made with stuff from the form and a query the include would not work for making the body.

What part of that process can I help with in this question?  Do you want just a brief outline or are you having a problem with a specific step?

I would basically start by getting the information from the form into variables on this page.  Then run the query.  The ASP script would then send the email and make the html for the resulting page.  All of these steps are possible in just ASP and without an include file.

Let me know how I can help with this.  Keep in mind that if you need specific help I will need more details.  Right now this is all really general but it sounds like the include file is unneeded and might even be problematic.  Let me know if you have a question.

bol
0
 
LVL 22

Assisted Solution

by:WMIF
WMIF earned 250 total points
Comment Utility
check out a method named "CreateMHTMLBody" of the cdosys object.

4th example from: (http://w3schools.com/asp/asp_send_email.asp)

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="mymail@mydomain.com"
myMail.To="someone@somedomain.com"
myMail.CreateMHTMLBody "http://www.w3schools.com/asp/"
myMail.Send
set myMail=nothing
%>


i use this to create emails that get values from db, session, etc.  you design the page as if someone would be accessing it directly, then call it with the email.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now