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
218 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
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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

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…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly ‚Ķ
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.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

831 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