Message submission rate for this client has exceeded the configured limit?
Asked Answered
B

3

10

I have a for loop which calls some code sending emails. I get the following run-time error:

Service not available, closing transmission channel. The server response was: 4.4.2 Message submission rate for this client has exceeded the configured limit

After googling around it appears to be related to the "set-receiveconnector", possible for exchange server? Could anyone advise how I can fix this?

the code:

             var mail = new MailMessage();
             var smtpServer = new SmtpClient(SMTPServer);

             mail.From = new MailAddress(fromAddress);
             mail.To.Add(toAddress);
             mail.Subject = title;

             mail.IsBodyHtml = isHTML;
             mail.Body = message;

             if(attach != null) mail.Attachments.Add(attach);

             smtpServer.Port = xxx
             smtpServer.UseDefaultCredentials = false;
             smtpServer.Credentials = new NetworkCredential(SMTPUser, SMTPPassword);
             smtpServer.EnableSsl = true;
             smtpServer.Send(mail); //Error occurs here
Bangweulu answered 27/1, 2012 at 13:18 Comment(4)
Given the error, does it not seem more likely this is just a throttling issue on the server to prevent mass spam sendings? You need to slow down your message submission rate.Trifid
I saw this though: "The message throttling policies doesn't apply to sending mails through SMTP so that can't be the reason." on the MSDN forum from one user?Bangweulu
Can't really answer that (I don't honestly know much about Exchange, hence commenting rather than answering). But the error message seems pretty self explanatory. Perhaps it's IP based throttling?Trifid
Im actualy only sending 8 emails :sBangweulu
C
6

Rather then sending the emails directly can you use a pickup folder?

SmtpMail.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;

that way you just dump the messages in to the folder and let exchange send them when its ready, this way if your user can only send say 3 per minute exchange should send 3 then on the next pass send another 3 and so on.

Contrary answered 27/1, 2012 at 16:39 Comment(3)
remember you need to set EnableSsl = false and also need absolute directory path in SmtpMail.PickupDirectoryLocationBlennioid
@Sturat, I like this solution. I was able to generate the .eml files. But how exactly can we configure exchange to pickup the mail?Richmal
@BharatRaj that is way out of scope for SO, had one over to serverfault and they'll sort you outContrary
B
1

I resolved this problem on my system by using the correct port. The way exchange had been set up meant that SSL = TRUE, Port = 587 produced this error. If I changed it to use Port 25, then everything worked just fine. So check with your sys admins this may help!

Bodice answered 27/11, 2015 at 11:15 Comment(1)
Thank you, Port 25 just saved meLye
J
0

We fixed this from the Exchange side by setting the receive connector(s) to allow more than 5 messages at a time, eg:

Get-ExchangeServer | Set-ReceiveConnector "My Receive Connector" -Messageratelimit 20
Jeddy answered 29/4, 2021 at 5:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.