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

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
neudealAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

b0lsc0ttIT ManagerCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
neudealAuthor Commented:
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
b0lsc0ttIT ManagerCommented:
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
WMIFCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.