Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bulk mail from asp

Status
Not open for further replies.

lee2k

Programmer
Aug 19, 2001
28
0
0
IN
hi,
i want to send mails (bulk mails) to the users who are all registered with my site. right now im using cdonts.newmail and looping around the recordset until the EOF.
i think this makes the server slow. is there any other possibility to send such bulk mails.
i think i can use MSMQ. but i dont know how to do.
ur help is needed. urgent.
thanx in advance
-lee

 
If your not worried about personalising the email why not just BCC everyone on one single email?
 
hi,
thanx for ur suggestion. but there is a limit in bcc. i dont know how much. if u know pls let me know
-lee
 
I think the limit is 255 recipients.

You could loop through your mailing list grouping 255 recipients together at a time and emailing them that way ...
 
thank u very much and ill try that
 
Hi guys

According to StoneDeCroze in this post, there isa limit of 255 recipients on a bcc or other field sending mail through asp. Could anybody confirm this please?

I'm using CDOSYS, running IIS 5.

Thanks in advance
A
 
Thank you Chris

So I take it the limit is set on the number of email addresses, rather than the size of the email address field in the database?
 
I recently used the bcc system to send out one mail via Cdosys (about 40 recipients) taking the entries from SQL DB.
See: I have been worried about the bcc limit too, in case my subscriber list goes over this spam limit.

The batches of 50 sounds like a great idea, can someone give me a rough example of the logic, i.e how you limit the recordset output and how you stop the email looping when you run out of entries please.

Thanks.

[sub]"Nothing is impossible until proven otherwise"[/sub]​
 
Hi Madanthrax

I've used the following myself, and it worked perfectly. Let me know if you have any questions and I'll be glad to help.

I'm doing this from the top of my head though without an environment to test on at the moment, so bear with me :)

Note that this is only for the logic of sending and cutting off a certain amount of recipients...not the actual syntax for sending mail. I have also assumed that you already retrieved the rows from the database and are working with a recordset called 'rs'


Code:
'Get all your email addresses from the database into an array.  Note that coming from the database, it will always be a 2 dim array

set EmailArr = rs.getrows()

max = 50       'or any limit you want to set for bcc


if isArray(EmailArr) then         ‘Make sure the array was loaded

 for i = 0 to ubound(EmailArr,2)      ‘Loop through every email address
   sTo = sTo & EmailArr(0,i) & “;”    ‘Adding it to the sTo field

   '1.Check if you've reached a point in the array, evenly 
   'divided by your max - you know that you must send then.
 
   '2. AND : Prevent it from sending when you are at your 
   ' first record - (0 will not have a remainder and will  
   ' past the MOD test

   '3.OR: Make sure that the last few records are sent as 
   ' well, even if the last email doesn't contain the whole 
   ' 50 records
   
   if (Max MOD i  =  0 AND i > 0  )  OR (i = ubound(EmailArr,2))
       'Call function sending the mail, passing your   
        recipients (assume this is already written)

        Call sendMail(sTo)

        sTo = ""      'Reset field

   end if
 next
End if

Let me know if anything is unclear
A
 
Great! Will have a go at this and see how I get on.

Thanks Annelize.

[sub]"Nothing is impossible until proven otherwise"[/sub]​
 
Also, if you want the lazy solution, head over to and download the mailing list program Bruce has on that site ... tried and tested by lots of people, and I've seen quite a few sites that use it.

Of course, I develop mostly in php, so I can't vouch for it, only going on what I've seen / heard people say about it ...

HTH

Greg Tammi, IT Design & Consultation
Work: Home:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top