问题描述
我有一个for循环这就要求一些code发送电子邮件。我得到以下运行时错误:
谷歌上搜索周围后,它似乎是关系到设置receiveconnector,可以为Exchange Server?任何人都可以提醒我如何才能解决这个问题?
在code:
VAR邮件=新MailMessage();
VAR SMTPSERVER =新SmtpClient(SMTPSERVER);
mail.From =新MailAddress(fromAddress);
mail.To.Add(的toAddress);
mail.Subject =称号;
mail.IsBodyHtml = isHTML;
mail.Body =消息;
如果(附!= NULL)mail.Attachments.Add(附后);
smtpServer.Port = XXX
smtpServer.UseDefaultCredentials = FALSE;
smtpServer.Credentials =新的NetworkCredential(SMTPUser,SMTPPassword);
smtpServer.EnableSsl = TRUE;
smtpServer.Send(邮件); //错误发生在这里
相反然后直接发送电子邮件,您可以使用Pickup文件夹?
SmtpMail.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
这样,你只转储邮件中的文件夹,并让交流时其准备好给他们,这样,如果你的用户只能派说,每分钟3交易所应该送3的话就下通再派3等
I have a for loop which calls some code sending emails. I get the following run-time error:
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
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.
这篇关于邮件提交率这个客户已经超过了配置的限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!