html message help

I

isaac2004

hi i am trying to send a html message that reiterates a invoice from a
online store site im making, i have the invoice written to the browser
but i would also like to send one to the customer via email

here is the code for the browser part
dim strSessionID, strISBN, strTitle

'open database for cart
strSQL = "SELECT tblCart.strSessionID, tblCart.strISBN, tblCart.intQty,
tblBookDescription.strTitle, tblBookDescription.dblPrice " & _
"FROM (tblBookDescription INNER JOIN tblCart ON
tblBookDescription.ISBN = tblCart.strISBN) "


objRS.Open strSQL, objConn

strISBN = objRS("strISBN")
strTitle = objRS("strTitle")
strSessionID = objRS("strSessionID")
%>
<center><font face='Comic Sans MS' color='#FF0000'>Order
Confirmation</font><br><br>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="600">
<tr>
<td width="159" valign="top"><font face="Comic Sans MS">Books
Shipped:</font></td>
<td width="437">
<%
'List each item in cart
dim intCount
do while NOT objRS.EOF
intCount = intCount + 1

%>
<tr>
<td valign="top" width="20" ><% =intCount %>.</td>
<td valign="top" width="256">
<! Book Title, author, stock >
<% dim Quan
If objRS("intQTY") = 1 then
Quan = "1 Copy of "
else if objRS("intQTY") > 1 then
Quan = objRS("intQTY") & " Copies of "
end if
end if
%>
<%=Quan%><br>
<font face="Comic Sans MS" color="#006699"><%
=objRS("strTitle")%></font>
<br>

<font size="-1">
by <% =funListAuthors(objRS("strISBN")) %></a>
</font>
<br>
<br>
</tr>
<% objRS.MoveNext
loop

objRS.close

dim strSQLOrder, iCount
'write order info to database

strSQLOrder = "SELECT tblOrders.strEmail, tblOrders.ISBN,
tblOrders.dtOrderDate " & _
"FROM tblOrders "
set objRS = Server.Createobject("ADODB.Recordset")
objRS.open strSQLOrder, objConn, ,adLockOptimistic
'response.write "strSQL:" & strSQL & "<br>"
For iCount= 1 to intCount

objRS.addnew
objRS("strEmail") = strEmail
objRS("dtOrderDate") = Now()
objRS("ISBN") = strISBN
objRS.update
objRS.movenext
Next
objRS.close

%>
<br>
</td>
</tr>
<tr>
<td width="159" valign="top"><font face="Comic Sans MS">Shipping
Address:</font></td>
<td width="437"><% =strFirstName & " " & strLastName & "<br>" &
strAddress & "<br>" & strCity & ", " & strState & ", " & strZip &
"<br><br>"%>

</td>
</tr>
<tr>
<td width="159" valign="top"><font face="Comic Sans
MS">Total:</font></td>
<% dim TotalPrice
TotalPrice = Request.cookies("TotalPrice")

response.write("<td width='437'>$" & TotalPrice)


i want the html message to go through the cart and list all the items
in the cart, right now i can only get it to list the first item in the
cart, i cant get the second, third, etc

here is the code for the html message

'assign the email message body to a variable
Dim strHTMLMessage
strHTMLMessage = "<a
href='http://yorktown.cbe.wwu.edu/06Winter/levini/A07/default.asp'> " &
_
"<img
src='http://yorktown.cbe.wwu.edu/06Winter/levini/images/logo.jpg'
border='0' alt='NetBooks Logo'> " &_
"</a><br> " &_
"<center><font face='Comic Sans MS'
color='#FF0000'>Order Confirmation</font><br><br> " & _
"<div align='center'> " & _
"<center> " & _
"<table border='0' cellpadding='0' cellspacing='0'
width="'600'> "
strHTMLMessage = strHTMLMessage & "<tr> " & _
"<td width='159' valign='top'><font face='Comic Sans
MS'>Books Shipped:</font></td>" & _
"<td width='437'> " & strTitle & _
"</td> " & _
"</tr> " & _
"<tr> " & _
"<td width='159' valign='top'><font face='Comic Sans
MS'>Shipping Address:</font></td> " & _
"<td width='437'>" & strFirstName & " " & strLastName
& "<br>" & strAddress & " <br>" & strCity & ", " & strState & ", " &
strZip & "<br><br>" & _
"</td> " & _
"</tr> " & _
"<tr> " & _
"<td width='159' valign='top'><font face='Comic Sans
MS'>Total:</font></td> " & _
"<td width='437'>$" & TotalPrice



'Create the mail object
Dim objMail
Set objMail = Server.CreateObject("CDO.Message")

'Set mail object properties
objMail.To = strEmail
objMail.From = "(e-mail address removed)"
objMail.Subject = "Order Confirmation from NetBooks"

objMail.HTMLBody = strHTMLMessage 'your HTML email message

'Optional properties
'objMail.TextBody = "Your email message in plain text for email clients
that do not support HTML"
'objMail.CC = "(e-mail address removed)"
'objMail.BCC = "(e-mail address removed)"

'Optional importance
'objMail.Fields("urn:schemas:httpmail:importance").Value = 2
'objMail.Fields.Update()

'Send the email
objMail.Send


thanks for the help
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top