Thread Title: Loop through a recordset and display the Values in an Email Message.

Thread Description (By: Carrzkiss):

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("Q_24421372.mdb") & ";"

Set RsOutstanding=CreateObject("ADODB.RecordSet")
getSQL = "SELECT * FROM dbo WHERE DisplayStatus = 2"
RsOutstanding.Open getSQL, objConn, 1, 1, 1



' ******** E NAG FOR HR Question and Answers Web ************

Response.write("&nbsp;&nbsp;&nbsp; eNAG Notices Sent Include:<BR>**************************************<BR>")

'If RsOutstanding_total <> "0" Then
'response.write("Q&quot;A Site<BR>")

Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")

objCDOSYSCon.Fields("") = ""
objCDOSYSCon.Fields("") = 25
objCDOSYSCon.Fields("") = 2
objCDOSYSCon.Fields ("") = False 'Use SSL for the connection (True or False)
objCDOSYSCon.Fields("") = 60

Set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = ""
objCDOSYSMail.To = ""
'objCDOSYSMail.BCC = ""
objCDOSYSMail.Subject = "Q&A Report"

objCDOSYSMail.HTMLBody = "&nbsp;Hello Bob,<BR><BR>This is your daily reminder that there are currently <B> " & RsOutstanding_total & " </B> questions in the Question and Answer Web that require your attention.<BR><BR>The following question(s) requires your attention.<BR><BR><B>"


While Not RsOutstanding.EOF
objCDOSYSMail.HTMLBody = objCDOSYSMail.HTMLBody & (RsOutstanding("Question")) & "<br>" & "<br>"

objCDOSYSMail.HTMLBody = objCDOSYSMail.HTMLBody & "<br/><br/> I hope this will work. we will see here in a minute.<BR><BR>"
objCDOSYSMail.HTMLBody = objCDOSYSMail.HTMLBody & "</B>Please Login to the Web Site at <a href=></a> and reply to them as soon as possible.<BR><BR>Thank you.<BR><BR><BR>****************************************************<BR><B><I>This email was automatically generated by the Web Server</I></B>."


Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing

'response.write ("No Reminder emails need to be sent")
'End IF
Set RsOutstanding = Nothing

Sorry, there is no Demo for this Article
Download Code (Some codes do not have .zip files with them, sorry!)

This Thread has been viewed: [ 600 ] times

Visit Carrzkiss of Experts Exchange at the following locations.
CFF Coding Source
=>Coding Source
Coding Source is a site designed for sharing of source codes, from different forms of software.
With over 100 Members and growing nearly every day!
Knowledge Base<=
Our Knowledge Base, is packed full of information to help you overcome your coding and trouble shooting issues.

Designed by: EE's very own Carrzkiss.
You know Carrzkiss from his reputation on Experts Exchange, now see his work in action.

EE.CFFCS.COM is Brought to you
by: CFFCS.COM - Carrz-Fox-Fire Coding Source) A ®Carrz-Fox-Fire Promotions©2000-2023 Company