|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
html message help
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 intCountobjRS.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 = "lev***@cc.wwu.edu" 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 = "csand***@wwu.edu" 'objMail.BCC = "chris.sand***@wwu.edu" 'Optional importance 'objMail.Fields("urn:schemas:httpmail:importance").Value = 2 'objMail.Fields.Update() 'Send the email objMail.Send thanks for the help "isaac2004" <isaac_2***@yahoo.com> wrote in message
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/_clb_sending_smtp_mail_by_port_25_using_cdosys_vb.asp
news:1142221381.151658.245450@i39g2000cwa.googlegroups.com... > can anybody help me with this > |
|||||||||||||||||||||||