title: SMTP through ASP.Net 2 Session Size Problem
body: <p>We've been having a problem with a mass mailer component that I wrote for a long time and the exact nature of the difficulty, how to measure it and how to mitigate it have all remained elusive.</p>
  
  <p>It's got to the point where these problems are becoming critical and I need some straight answers so I'm hoping someone here can provide them.</p>
  
  <p>Basically this mass mailer widget just sends out approx 25k emails one email at a time to a mail list. This is our much preferred message because it means each recipient receives a mail addressed to them personally, so we're happy with that loop.</p>
  
  <p>What we're not happy with is that if you just leave the program to process after approx 6k emails we get an error that the "Maximum Session Size" has been reached and it's not going to send any more mails.</p>
  
  <p>We have no real way of knowing at present which mail it got up to, our only method of throttling is based on guess work and involves sending out 1k emails every 90 seconds by manual button press.</p>
  
  <p>I've searched until my head is sore for some indication of how to track the emails as they go out, how to measure the session size or something to just allow the process to be one button press and for the widget to be self-throttling but no one seems to want to talk about it online.</p>
  
  <p>I've had a few suggestions to related queries that suggest completely reworking the widget or even writing a bespoke mass-mailing app.</p>
  
  <p>In the end all we want to do is throttle the outgoing mail so it doesn't cause an error, or, if this is unavoidable allow it to count the mails sent and give us some clue where to pick up, or even gracefully handle the error. Something. Anything.</p>
  
  <p>Does anyone have any down to earth and practical suggestions for tracking .Net 2.0 generated emails out of the originating server?</p>