Looping Form Results using CDO

Results 1 to 2 of 2

Thread: Looping Form Results using CDO

  1. #1
    snihan Guest

    Default Looping Form Results using CDO

    Anyone had any experience with looping CDO? I have a results.asp page that returns email addresses, and I want to be able to email to all emails listed on the page, using CDO. How do I get it to loop through all the records returned on the page??

  2. #2
    J. Paul Schmidt Guest

    Default RE: Looping Recordset And E-mail Each

    Perhaps check out this resource:<BR><BR>ASP News Letter by Faisal Khan<BR>http://www.stardeveloper.com/asp_newsletter_1.asp<BR>Loops thru recordset and sends an e-mail to each:<BR>source<BR> While Not rs.EOF<BR> Set mail = Server.CreateObject("CDONTS.NewMail")<BR> mail.From = "webmaster@yoursite.com"<BR> mail.To = rs("email")<BR> mail.Subject = subject<BR> mail.Body = message & rs("email")<BR> mail.Send<BR> Set mail = Nothing<BR> no = no + 1<BR> rs.MoveNext<BR> Wend<BR> &#039; When messages have been sent to all the users, exit<BR> Response.Write "Emails sent to " & no & " users."<BR><BR>Best regards,<BR>-Paul<BR><BR>J. Paul Schmidt, MBA<BR>Databases on the Web<BR>http://www.Bullschmidt.com<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts