What I've been up to...sending Bulk Email from ASP.NET / Command line / Schedule (English)

What I've been up to...sending Bulk Email from ASP.NET / Command line / Schedule

Friday, 12 March 2004

//

2 minute read

Been a bit quiet of late, well basically I've been starting a new project at work - so I've been pretty much 24/7 in planning and building that app. It's a pretty cool little Bulk Email app (don't worry, for strictly opt-in mails :-)). A couple of the bits I've been using in this app are really useful in general, Mike Woodring's Custom ThreadPool, this is just a remarkably useful little class when you want to do Asynchronous operations from within ASP.NET (see this for more details on some of the places you may want to do this). Esssntially within the application, I accept a large(ish) XML file which contains details for users (using “18000 in my test file), parse it; using XmlTextReader, the performance and memory usage of this class is just stunning, it can work through this 200000+ line file in less than a second (not too exact, don't have timing on there yet) and populate an object containing an arraylist of multiple DataTables. I have vastly underused DataTables in the past, but they are just incredibly useful for holding arbitrary data, and really easy to build dynamically. This object can then either be serialized to disk (allowing for scheduling for a later send) or fired to my mail controller immediately, this essentially spins up n threads to handle the mail sending operations (allocated from a static thread pool). The component I use for actually doing the mail merge is the excellent AspNetEmail form AdvancedIntellect , now I can't say enough about this product (I found what appears to be a very minor bug with the 'send status' but have yet to confirm this...). What I can do with this is, pass a DataTable (you can also pass a DataSet or SqlDataReader), fill in some fields and let it work through the table sending emails, with the class calling back into my code to give details on each send - very nice! Anyway, I'm now working on reporting functionality for this app and 'tweaking' (currently hits “200 mails/second limited by the file-system, can do “1100 mails/sec if the file system is taken out of the equation) - have to say it's been a lot of fun, the multi-threading capabilities of .NET have really impressed me lately - my new favourite feature :-)

Also been to an MSDN roadshow today hmm...can't say it was the best use of my time, HEAVY on the marketing spiel, very low technical content, basically they were showing off .NET technology at a 'managers' level - very tedious...the Smart Client stuff using Office 2003 was pretty interesting though...got a new respect for InfoPath...

logo

© 2025 Scott Galloway — Unlicense — All content and source code on this site is free to use, copy, modify, and sell.