Can anyone help!
I am trying to send the contents of an access database table in the body of an email using CDONTS. However, when the email is sent only the first row of the db table is displayed. how do i move to the next record? so the table contains all the relevant records?
this is what i have been trying;
sqlString = "SELECT order_id, FROM etc...
emailRS.Open sqlString
%>
<%
Dim sMailBody
Set NewMailObj = CreateObject ("CDONTS.NewMail"
NewMailObj.From = "blah blah.com"
NewMailObj.To = "anyone"
NewMailObj.Subject = "New Order Received!"
NewMailObj.BodyFormat = CdoBodyFormatHTML
NewMailObj.MailFormat = CdoMailFormatMime
sMailBody = sMailBody & "<HTML><HEAD><TITLE>New order</TITLE></HEAD>"
sMailBody = sMailBody & "<BODY><TABLE width=""600"" border=""1"" cellpadding=""4"" cellspacing=""0"">"
sMailBody = sMailBody & "<TR><TH>Product</TH><TH>Description</TH><TH>Quantity</TH><TH>Price</TH><TH>Order Date</TH></TR>"
sMailBody = sMailBody & "<tr><td>" & emailRS("product_partnumber" & "</td>"
sMailBody = sMailBody & "<td>" & emailRS("product_briefdesc" & "</td>"
sMailBody = sMailBody & "<td>" & emailRS("order_quantity" & "</td>"
sMailBody = sMailBody & "<td>" & emailRS("product_price" & "</td>"
sMailBody = sMailBody & "<td>" & emailRS("order_entrydate" & "</td>"
sMailBody = sMailBody & "</table>"
NewMailObj.Body = sMailBody
NewMailObj.Send
When this is run, the email is delivered oK, but only contains the first row of products. if more than one product has been ordered, they are missing.
hope someone can help!!
I am trying to send the contents of an access database table in the body of an email using CDONTS. However, when the email is sent only the first row of the db table is displayed. how do i move to the next record? so the table contains all the relevant records?
this is what i have been trying;
sqlString = "SELECT order_id, FROM etc...
emailRS.Open sqlString
%>
<%
Dim sMailBody
Set NewMailObj = CreateObject ("CDONTS.NewMail"
NewMailObj.From = "blah blah.com"
NewMailObj.To = "anyone"
NewMailObj.Subject = "New Order Received!"
NewMailObj.BodyFormat = CdoBodyFormatHTML
NewMailObj.MailFormat = CdoMailFormatMime
sMailBody = sMailBody & "<HTML><HEAD><TITLE>New order</TITLE></HEAD>"
sMailBody = sMailBody & "<BODY><TABLE width=""600"" border=""1"" cellpadding=""4"" cellspacing=""0"">"
sMailBody = sMailBody & "<TR><TH>Product</TH><TH>Description</TH><TH>Quantity</TH><TH>Price</TH><TH>Order Date</TH></TR>"
sMailBody = sMailBody & "<tr><td>" & emailRS("product_partnumber" & "</td>"
sMailBody = sMailBody & "<td>" & emailRS("product_briefdesc" & "</td>"
sMailBody = sMailBody & "<td>" & emailRS("order_quantity" & "</td>"
sMailBody = sMailBody & "<td>" & emailRS("product_price" & "</td>"
sMailBody = sMailBody & "<td>" & emailRS("order_entrydate" & "</td>"
sMailBody = sMailBody & "</table>"
NewMailObj.Body = sMailBody
NewMailObj.Send
When this is run, the email is delivered oK, but only contains the first row of products. if more than one product has been ordered, they are missing.
hope someone can help!!