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
220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 250 total points
ID: 18885633
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
ID: 18885753
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
ID: 18885873
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
ID: 18886061
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

691 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