Limit number of emails sent by EmailTraceListener

Oct 2, 2009 at 8:49 AM

Hi,

Is there a way to limit the number of emails sent?

Example: the database crashes so a bunch of errors occur, so i have a million emails send to me. Can i make it stop after, let's say, 100 emails. 

Oct 2, 2009 at 2:18 PM

Hi,

With the current implementation of the email tracelistener there is no way you can limit the number of mail sent. But you can modify the email trace listener source code to stop the sending when a certain number is reached. You also can implement your custom trace listener with that behavior.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Oct 15, 2009 at 6:03 AM

Hi,

Thanks for the reply.

I now have 1000 errors (database crash again) so i guess i'll do.. somethig. Implementing my own custom listener sounds like the best choice.

Have a great day.

Nov 24, 2010 at 9:52 PM

Possible solution

http://stackoverflow.com/questions/4268235/how-to-configure-emailtracelistener-to-avoid-over-flooded-mailbox-on-mass-probl