Hi All,
Below are the objMail that I need to send by email using ASPmail, when I send this form I receive only 1 record from the SQL database and it seems the 'rsProd.MoveNext' and 'wend' doesn't work properly.
Can you point me to the right direction how to 'Loop' this recordset.
set rsProdInfo = Server.CreateObject("ADODB.Recordset")
rsProdInf
pen "balls", Conn, adOpenStatic, adLockOptimistic, adCmdTable
intTotal = 0
rsProd.MoveFirst
do while not rsProd.EOF
rsProdInfo.MoveFirst
rsProdInfo.Find "productID = " & rsProd("productID")
intProdID = rsProdInfo("catalogID")
intProdIDshow = rsProdInfo("productID")
intImgNumber = rsProdInfo("ImgNumber")
intMKT = rsProdInfo("MKT")
strProdName = rsProdInfo("itemname")
intPrice = formatNumber(rsProdInfo("productPrice"), 2)
intQuant = rsProd("quantity")
intExtPrice = formatNumber((intPrice * intQuant), 2)
intTotal = intTotal + intExtPrice
sBody = "<html dir=ltr>" & _
"<head>" & _
"</head>" & _
"<body >" & _
"<tr>" & _
"<td width=15" & "%" & " valign=center align=center style=border: 1px solid #E1E2CB; nowrap><font face=arial size=2>" & intQuant & "</font></td>" & _
"<td width=15" & "%" & " valign=center align=center style=border: 1px solid #E1E2CB; nowrap><font face=arial size=2><a href=index.asp?intCatalogID=" & intProdID & "&" & "pid=" & intImgNumber & ">" & intMKT& "</a></font></td>" & _
"<td width=37" & "%" & " valign=center align=center style=border: 1px solid #E1E2CB; nowrap><font face=arial size=2><a href=index.asp?intCatalogID=" & intProdID & "&" & "pid=" & intImgNumber & ">" & strProdName & "</a></font></td>" & _
"<td width=17" & "%" & " valign=center align=center style=border: 1px solid #E1E2CB; nowrap><font face=arial size=2>" & intPrice & "</font><font face=arial size=2> $</font></td>" & _
"<td width=15" & "%" & " valign=center align=center style=border: 1px solid #E1E2CB; nowrap><font face=arial size=2>" & intExtPrice & "</font><font face=arial size=2> $</font></td>" & _
"</tr>" & _
"<input type=hidden name=strOrderItem value=" & intProdIDshow & "," & intQuant & ">" & _
"</body>" & _
"</html>"
rsProd.MoveNext
wend
Dim objMail
strEmail = Request.Form("strEmail")
sSubject = "test"
Set objMail = Server.CreateObject("SMTPsvg.Mailer")
objMail.RemoteHost = "mail.mydomain.com" ' Specify a valid SMTP server
objMail.FromAddress = "admin@mydomain.com"
objMail.FromName = "My Name"
objMail.Recipient = strEmail
objMail.Subject = sSubject
objMail.BodyText = sBody
objMail.ContentType = "text/html"
objMail.Priority = 0
objMail.SendMail
Set objMail = Nothing
Below are the objMail that I need to send by email using ASPmail, when I send this form I receive only 1 record from the SQL database and it seems the 'rsProd.MoveNext' and 'wend' doesn't work properly.
Can you point me to the right direction how to 'Loop' this recordset.
set rsProdInfo = Server.CreateObject("ADODB.Recordset")
rsProdInf
intTotal = 0
rsProd.MoveFirst
do while not rsProd.EOF
rsProdInfo.MoveFirst
rsProdInfo.Find "productID = " & rsProd("productID")
intProdID = rsProdInfo("catalogID")
intProdIDshow = rsProdInfo("productID")
intImgNumber = rsProdInfo("ImgNumber")
intMKT = rsProdInfo("MKT")
strProdName = rsProdInfo("itemname")
intPrice = formatNumber(rsProdInfo("productPrice"), 2)
intQuant = rsProd("quantity")
intExtPrice = formatNumber((intPrice * intQuant), 2)
intTotal = intTotal + intExtPrice
sBody = "<html dir=ltr>" & _
"<head>" & _
"</head>" & _
"<body >" & _
"<tr>" & _
"<td width=15" & "%" & " valign=center align=center style=border: 1px solid #E1E2CB; nowrap><font face=arial size=2>" & intQuant & "</font></td>" & _
"<td width=15" & "%" & " valign=center align=center style=border: 1px solid #E1E2CB; nowrap><font face=arial size=2><a href=index.asp?intCatalogID=" & intProdID & "&" & "pid=" & intImgNumber & ">" & intMKT& "</a></font></td>" & _
"<td width=37" & "%" & " valign=center align=center style=border: 1px solid #E1E2CB; nowrap><font face=arial size=2><a href=index.asp?intCatalogID=" & intProdID & "&" & "pid=" & intImgNumber & ">" & strProdName & "</a></font></td>" & _
"<td width=17" & "%" & " valign=center align=center style=border: 1px solid #E1E2CB; nowrap><font face=arial size=2>" & intPrice & "</font><font face=arial size=2> $</font></td>" & _
"<td width=15" & "%" & " valign=center align=center style=border: 1px solid #E1E2CB; nowrap><font face=arial size=2>" & intExtPrice & "</font><font face=arial size=2> $</font></td>" & _
"</tr>" & _
"<input type=hidden name=strOrderItem value=" & intProdIDshow & "," & intQuant & ">" & _
"</body>" & _
"</html>"
rsProd.MoveNext
wend
Dim objMail
strEmail = Request.Form("strEmail")
sSubject = "test"
Set objMail = Server.CreateObject("SMTPsvg.Mailer")
objMail.RemoteHost = "mail.mydomain.com" ' Specify a valid SMTP server
objMail.FromAddress = "admin@mydomain.com"
objMail.FromName = "My Name"
objMail.Recipient = strEmail
objMail.Subject = sSubject
objMail.BodyText = sBody
objMail.ContentType = "text/html"
objMail.Priority = 0
objMail.SendMail
Set objMail = Nothing