How throttle email queue

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
8/28/2020 6:21:51 AM
Total Posts 128

How throttle email queue

We're sending emails from a site using the mojoPortal email mechanism mojoPortal.Net.Email, but sometimes hitting limits in the Office 365 email relay. Entries like this in the log

2020-08-27 14:52:32,736 ERROR (null) - (null) - (null) - mojoPortal.Net.Email - error sending email to from, will retry 
System.Net.Mail.SmtpException: Syntax error, command unrecognized. The server response was: 4.3.2 STOREDRV.ClientSubmit; sender thread limit exceeded []
   at System.Net.Mail.DataStopCommand.CheckResponse(SmtpStatusCode statusCode, String serverResponse)
   at System.Net.Mail.DataStopCommand.Send(SmtpConnection conn)
   at System.Net.ClosableStream.Close()
   at System.Net.Mail.SmtpClient.Send(MailMessage message)
   at mojoPortal.Net.Email.Send(SmtpSettings smtpSettings, MailMessage message)

We think we're simply exceeding the number of concurrent sends and perhaps also the number of messages per minute that are supported by O365, as per 

I've seen that the mojoPortal Newsletter and Forums both have settings to throttle the email sending.

    <add key="NewsletterMaxToSendPerMinute" value="0" />
    <add key="Forum:NotificationMaxToSendPerMinute" value="0" />

Is there similar for global emailing? Any other suggestions? (Using a different email provider is not a solution available in the immediate situation).


9/2/2020 1:00:45 PM
Total Posts 2241

Re: How throttle email queue

Hi Crispin,

We don't have throttling controls outside of the newsletter and the forums. 

The throttling in those features is implemented within them only, not within the email system itself.

The throttling is actually quite simple in the newsletter and can be found in the LetterSendTask.cs code.

Are you sending email through a custom feature? If so, try implementing the same logic that's used in LetterSendTask.cs. If not, what is sending so much email on your site?


9/2/2020 3:48:25 PM
Total Posts 128

Re: How throttle email queue

Hi Joe, yes this is from custom features which can send a lot of emails, so yes next step is to look to implement throttling ourselves, as you suggest. First we just wanted check there wasn't something built in already.

Thanks for pointing us at


You must sign in to post in the forums. This thread is closed to new posts.