我有一个 for 循环调用一些代码发送电子邮件。我收到以下运行时错误:
Service not available, closing transmission channel. The server response was: 4.4.2 Message submission rate for this client has exceeded the configured limit
谷歌搜索后它似乎与“set-receiveconnector”有关,可能用于交换服务器?谁能告诉我如何解决这个问题?
代码:
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
最佳答案
您可以使用取件文件夹而不是直接发送电子邮件吗?
SmtpMail.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
这样你只需将消息转储到文件夹中并让交换在准备就绪时发送它们,这样如果你的用户每分钟只能发送 3 个交换应该发送 3 然后在下一次发送另一个 3 等等.
关于c# - 此客户端的消息提交速率已超过配置的限制?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9033815/