CDONTS problem still not fixed

Results 1 to 3 of 3

Thread: CDONTS problem still not fixed

  1. #1
    Rich Hall Guest

    Default CDONTS problem still not fixed

    I am using the mailing list script from the 4 guys site that utilizes cdonts...<BR><BR>Here is the snippet of code that therein lies the problem:<BR>While Not recordset.EOF<BR> &#039;create a new cdo object<BR> Set objCDOMail = Server.CreateObject("CDONTS.NewMail")<BR> &#039;set its properties<BR> objCDOMail.From = ""<BR> objCDOMail.BCC = recordset("list_mail")<BR> objCDOMail.Subject = subject<BR> objCDOMail.Body = message<BR> &#039;send the mail<BR> objCDOMail.Send<BR> &#039;set the object = nothing<BR> Set objCDOMail = Nothing<BR> &#039;go to the next record<BR> recordset.MoveNext<BR> WEND<BR><BR>Notice that as it loops through the recordset, it creates a new mail object every time, get&#039;s the recipient, sends the mail, closes the mail object and then starts the process again sending to the next address in the dbase.<BR><BR>The problem is, I am accumulating quite a few addresses in this database, and I am assuming there is a way to isolate the loop and populate all the addresses before the mail is sent, so it only does it once. <BR><BR>If I move the loop and put it around the objCDOMail.BCC = recordset("list_mail") statement, it will just use the last address.<BR><BR>Does anyone know of a way to fix this, or any queuing functions that would speed up the script for my users. Sending to 500 people takes around 2 minutes and the dbase is going to get bigger.<BR>Thanks,<BR>Rich hall

  2. #2
    Eskil Lundgren Guest

    Default RE: CDONTS problem still not fixed

    I really don´t remember clearly, but I think you just can use the ";" to separate recipients.<BR>So:<BR>&#039;create object here<BR>Do until rs.eof<BR> strRecipients = strRecipients & ";" & rs("eMail").value<BR> rs.MoveNext<BR>Loop<BR>objName.To = strRecipients<BR><BR>I think this will do the trick, any way you can send to multiple recipients, that much I know just can´t remember if that was the correct way. Might also be some kind of a user limit to this approach, which I never reached since it was only about 150 user to mail.<BR><BR>If it doesn´t work, at least don´t create the object for each loop. It should be enough just to:<BR><BR>Createobject<BR>Do until rs.eof<BR>&#039; create the mail and send it<BR>rs.movenext<BR>Loop<BR>Remove object

  3. #3
    Rich Hall Guest

    Default Hmm....neither approach worked

    I think you can only send mail once per object created. So the second approach didn&#039;t work.<BR><BR>The first one didn&#039;t error out, but it didn&#039;t send any mail.

Posting Permissions

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