Results 1 to 2 of 2

Thread: email

  1. #1
    Join Date
    Dec 1969

    Default email

    guys I just can&#039;t get this to work the right way:<BR>its supposed to sent three emails (in my db) buts its sending 5 instead! don&#039;t want to annoy my subscribers...what am I doing wrong here<BR><BR>do while not rs.EOF<BR>set objMail = Server.CreateObject("CDO.Message")<BR> strCC = strCC & rs("email") & ";"<BR> <BR><BR> ObjMail.From=""<BR> ObjMail.Subject="RogersVideo Promotion Alert"<BR> ObjMail.HTMLBody=HTML<BR> objMail.CC = strCC<BR> ObjMail.Send<BR> <BR> rs.MoveNext <BR> set ObjMail = Nothing <BR> loop <BR><BR>Many thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: email

    your problem is with strCC. you&#039;re not resetting it each time you loop through. on your first iteration it&#039;ll be<BR><BR>;<BR>second iteration it&#039;ll be<BR>;;<BR>third it&#039;ll be<BR>;;;<BR><BR>and you&#039;re sending a mail each time you go through the loop. either send each individually like so :<BR><BR>do while not rs.EOF<BR>set objMail = Server.CreateObject("CDO.Message")<BR>strCC = rs("email") & ";"<BR><BR><BR>ObjMail.From="promotions@rogersvide"<BR>ObjMail.Subject="RogersVideo Promotion Alert"<BR>ObjMail.HTMLBody=HTML<BR>objMail.CC = strCC<BR>ObjMail.Send<BR><BR>rs.MoveNext <BR>set ObjMail = Nothing <BR>loop <BR><BR><BR><BR><BR>or just do one send after building the CC string.<BR><BR><BR>j<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