Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Sending >10000 emails
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Sending >10000 emails

 Post Reply Post Reply
Author
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Topic: Sending >10000 emails
    Posted: 19 January 2006 at 2:01pm

If I am going to send more than 10,000 emails through CDONTS, and after increasing the server timeout... what are the best techniques used to do so, and how can i send this in mail shots, lets say 1000 every time.

 
I'm currently using this simple code:
 

ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("db.mdb")
Set ADO=Server.CreateObject("ADODB.Connection")
ADO.ConnectionString =ConnectionString
ADO.Open
selectSQL="select * from maillist"
set rs=ADO.execute(selectSQL)
do while not rs.eof
set mailObj = Server.CreateObject("CDONTS.NewMail")
mailObj.BodyFormat = 0
mailObj.MailFormat = 0
mailObj.From = Request("From")
mailObj.Subject = Request("Subject")
mailObj.Importance= 0
mailObj.Body = Request("Message")
mailObj.To = rs("email")
mailObj.Send
Response.Write rs("email") &"<BR>"
rs.movenext
loop
rs.close
Back to Top
Darbs View Drop Down
Newbie
Newbie


Joined: 09 December 2005
Location: United Kingdom
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote Darbs Quote  Post ReplyReply Direct Link To This Post Posted: 19 January 2006 at 2:50pm

use select top 1000 where id>'nnnnn' and call a sub routine.....

or you could use select .....  where emailname like 'a%' and call the sub - then do 'b%','c'%,'d%' etc....  and break it into chunks alphabetically (not forgetting those names that start with a non alphabet chars obviously)..... 
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 19 January 2006 at 6:04pm
Also place the creating of the CDONTS object outside of the loop, that way you use less server resouces.

And don't forget to distroy the object when you finsh.
Back to Top
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: 23 January 2006 at 4:34pm
i tried to use the CDONTS object outside of the loop but it gave me an error... also it gave me an error when i tried to close the object.Shocked
 
I'll give it another try...
Back to Top
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post Posted: 25 January 2006 at 2:16am
I wouldn't use a CDONTS loop, I've tried before it just gets loads of problems and ASP really is designed for doing something like that.

I would recommend using a program or buying one designed to mass mail.
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 26 January 2006 at 1:30am
Check out the postcast server - free download and runs from your pc. IIRC, it can import text and csv

Lead me not into temptation... I know the short cut, follow me.
Back to Top
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: 27 January 2006 at 6:36pm
I made the scripts in a very nice way...
The CDONTS page sends 100 emails per page, then at the end of the page, there is a JavaScript code

<%If PageNum <> AllPages Then%>
<Script>
function flyto(){
window.location.href('SendMail.asp?&Page=<%=PageNum + 1%>')
}
setTimeout("flyto()",3000)
</Script>
<%End IF%>
 
In this way, if I've 10,000 emails, and I was displaying them 100 per page, so I'll have 100 page.
 
It sends the 1st 100 emails (Page 1), and then goes to page 2, 3, ...etc with a javascript code so i can set the time between every send.
 
 
The way it goes is nice, it shows you how many emails was sent between pages, if any error occured, you can refresh.. and the script will continue working.
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 27 January 2006 at 11:49pm
Elegant Thumbs Up 

Lead me not into temptation... I know the short cut, follow me.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.