无法发送给收件人:c# 异常

Unable to send to a recipient : c# exception

简介

我正在开发应用程序模块,该模块应该向列表中的用户发送超过 1000 封电子邮件....

问题

负责发送电子邮件的代码对于前 100 封电子邮件工作正常,但随后会在此函数上引发异常,

smtp.Send(mail);

I been trying to figure out whats wrong, i have tried several techniques(like creating delay in sending emails, i.e: chunks of 50 emails per minute) but when count reaches about 100 email,,,, i experiences this exception....

代码

m.From = new MailAddress("abcs@gmail.com", "abc");
                m.To.Add(new MailAddress(to, ""));
                m.Subject = subject;
                m.IsBodyHtml = true;

                var fromAddress = m.From.Address.ToString();

                var toAddress = to;
                const string fromPassword = "*****";
                //string body = "From: " + message + "\n";
                //body = message;
                var smtp = new System.Net.Mail.SmtpClient();
                {
                    smtp.Host = "smtp.gmail.com";
                    smtp.Port = 587;
                    smtp.EnableSsl = true;
                    smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
                    smtp.UseDefaultCredentials = false;
                    smtp.Credentials = new NetworkCredential(fromAddress, fromPassword);
                    // smtp.Credentials = new NetworkCredential(fromAddress, fromPassword);
                    smtp.Timeout = 200000;
                }
                smtp.Send(m);

异常

System.Net.Mail.SmtpFailedRecipientsException was caught
      HResult=-2146233088
      Message=Unable to send to a recipient.
      Source=System
      FailedRecipient=<abcs@gmail.com>
      StackTrace:
           at System.Net.Mail.SmtpClient.Send(MailMessage message)
           at FlexiAnalysisLib.Common.MailHelper.AnalysisEmailViaAlternateView(String to, String subject, MailMessage m) in c:\beta development\FlexiAnalysisLib\Common\MailHelper.cs:line 553
      InnerException: System.Net.Mail.SmtpFailedRecipientException
           HResult=-2146233088
           Message=Insufficient system storage. The server response was: 4.5.3 Your message has too many recipients. For more information regarding
           FailedRecipient=<abcs@gmail.com>

If anyone have idea about the problem, please help...

任何形式的帮助或参考都将不胜感激.... 感谢您的宝贵时间

这是您使用的任何电子邮件服务施加的限制。

Google 有一个关于这个错误的支持页面,我认为它揭示了为什么存在这个限制:https://support.google.com/mail/answer/22839

Message bounced due to sending limit

In an effort to fight spam and prevent abuse, Google will temporarily disable your account if you send messages to more than 500 recipients or if you send a large number of undeliverable messages. If you use a POP or IMAP client (for example: Microsoft Outlook or Apple Mail), you may only send a message to 100 people at a time. Your account should be re-enabled within 24 hours.

If you communicate with the same group of people on a regular basis, you might be interested in Google Groups.

If you send a large number of undeliverable messages, we suggest verifying your contacts' email addresses. It's also important that everyone you are sending mail to is willing to receive it.

Learn more about best practices for sending a large amount of mail through Gmail.