Limit number of emails sent by EmailTraceListener

Oct 2, 2009 at 9:49 AM


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 3:18 PM


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.

Oct 15, 2009 at 7:03 AM


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 10:52 PM

Possible solution