sipariş ver dediğinde arka planda aldığı ürünleri listeleyip mail göndermem gerekiyor. Ne yaptıysam döngü olmasına rağmen ekrana sadece en sonuncu ürün geliyor. Bir yerde hata yapıyorum ama çözemedim. Kodlarım aşağıda. MAILBody i yazdırdığım yerde sepetteki ürünlerin hepsinin alt alta yazması lazım. Çünkü bir sonraki kod Persist Mail postalama kodu.
set sepet = server.createobject("adodb.recordset")
sqlSPT="SELECT * FROM [SEPET] where [USERID] = "& USERID &" order by [ID]"
sepet.open sqlSPT,bag,1,3
if sepet.eof then
msj = "Sepetinizde ürün yok."
Response.Redirect("index.asp?islem=sepet&msg="&msj)
else
do while not sepet.eof
st = st + 1
set urun = bag.execute("SELECT * FROM [SAYFALAR] where [ID] = "& sepet("URUNID"))
MAILBody = "<table border='1' bordercolor='#cccccc' bgcolor='#ffffff' cellpadding='3' cellspacing='1' width='100%'>"
MAILBody = MAILBody & "<tr>"
MAILBody = MAILBody & "<td style='width:28px; text-align:center'>"& st &"</td>"
MAILBody = MAILBody & "<td style='text-align:left;'>"& urun("SAYFAADI") &"</td>"
MAILBody = MAILBody & "</tr></table>"
MAILBody = MAILBody
sepet.movenext:loop
end if
sepet.Close
Set sepet= Nothing
response.Write(MAILBody)
response.End()