asp.net - 我如何限制在 asp.net 中每分钟使用 SmtpClient (System.Net.Mail) 发送的邮件数量?

标签 asp.net sendmail smtpclient mail-server

我有一次发送超过 20000 封警报邮件的需求,并且想限制每分钟发送的邮件数量。

除了在每次发送后提供 System.Thread.Sleep(1000) 之外,是否有任何内置/替代方法可以与 SmtpClient 一起使用来执行此操作?

System.Thread.Sleep(1000) 是否有助于克服邮件服务器可以同时处理的有限连接数

最佳答案

我认为您的方向是正确的。

默认情况下,SMTP 客户端不提供任何方法来限制每分钟发送的邮件。 因此,使用 sleep 是一种方法。

要使您的应用程序具有响应性,您可以使用线程。

关于asp.net - 我如何限制在 asp.net 中每分钟使用 SmtpClient (System.Net.Mail) 发送的邮件数量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5428789/

相关文章:

linux - 将电子邮件从 "bugzilla-daemon"发送到 "abc@xyz.com"时出错 : no sender

c++ - Smtp客户端发送数据后挂起

c# - 发送批量电子邮件时出错 "An asynchronous call is already in progress. It must be completed or canceled before you can call this method"

c# - 生成word文档并用html设置方向景观

asp.net - 为什么 ASP.NET 尝试为 Web 服务引用生成临时类?

c# - 存储在同一位置的 Azure 缓存中的 session 在多个实例上不同步

php - Swiftmailer 4 不会将退回邮件检索为 $failedRecipients

matlab - 如何从 Matlab 发短信给手机?

.net - Microsoft 停用 SmtpClient 的原因可能是什么?

asp.net - Windows Azure 平台上的 Web 应用程序中的 session 超时