Sending HTML with nested ASP variables in an email

C

Cindy

Hello Everyone,

I have a series of asp pages that write/read informaiton to/from a Database
about my Quality Documents. I'm trying to find a way to send the email
notifications to our subscribers each time a new revision of a document is
released.

My code is below. Here is my question. Is there a way to send everything
that is printed to the window in an email? If so, how do I set the HTMLBody
of the message to the html code. Won't the nested "quotes" get things messed
up? Should I write everything to a file and then email the file? If so, can
you give me some pointers on that process?

Right now, I just copy what appears on the page and slap it in an email.
But it sure would be nice to avoid this step. I've been successful in
sending emails for other applications I've written...but this one stumps me.
Any help or pointers to helpful
informaiton would be greatly appreciated!

Regards,
Cindy W.

-----------------
<p>You have subscribed to a document which been updated and released. </p>
<p>Revision "<%=rData(5)%>" of Procedure <%=rData(0)%> -<%=rData(2)%> was
approved and released on <%=rData(6)%>.
</p>
<p>Summary of Key Changes:</p>
<dir>
<dir>
<font FACE="Times New Roman" SIZE="2" COLOR="#0000ff">
<%=ChangeSummary%>
</font>
</dir>
</dir>

<p>The new file is available at <a href="<%=rData(4)%>"><%=rData(4)%> </a>
<% If rData(17) = "Yes" Then%> <p style="margin-bottom: 0"> Attachments
exist for this procedure and are Listed Here:</p>
<%
SQL = "SELECT * FROM AttachTbl WHERE (((DocNum)='" & Data0 & "'))"
set attData=dbConnection2.execute(SQL)
do while not attData.eof%>
<p style="margin-top: 0; margin-bottom: 0">

<a href="<%=attData(2)%>"><%=attData(0)%>a</a> -- <%=attData(3)%> --
Revision: <font color="#0000FF"><%=attData(5)%></font></p>
<%
attData.movenext
loop
End If
%>
</p>
 
K

Kevin Spencer

ASP requires a web server running the ASP ISAPI to work. So, what you *can*
do is to compose the email as a string using ASP to substitute the variable
values, and then send the string as the body of your email.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Shooter
http://unclechutney.blogspot.com

A man, a plan, a canal, a palindrome that has.. oh, never mind.
 
C

Cindy

Kevin - Thank you! Didn't think of using a string. DUH! Was definately
having a senior "Over 40" moment.

Tried it and it works like a charm. Thanks for saving me literally 20
minutes each day! My emails will not go out without an extra time wasting
step!

Regards,
Cindy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top