发送20000与asp.net电子邮件 [英] Sending out 20,000+ emails with asp.net

查看:120
本文介绍了发送20000与asp.net电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写这将需要电子邮件的巨量发送给谁将会从我们的数据库中选择了我们学生的应用程序(每封电子邮件将个性化,甚至包括他们的姓名,学习等,当然程度...所以需要发送一次一个)。

I am writing an application that will need to send a massive amount of emails to our students who will be selected from our database (each email will be personalized to the extent that will include their name, course of study etc...so needs to be sent one at a time).

我能做到这一点循环执行SmtpClient,但恐怕与数字我想送,我最终会遇到超时问题,或由于缺乏计算机资源的我的线程被杀害。

I could do this looping over an SmtpClient, but I'm afraid that with the numbers I'm trying to send, I'll ultimately run into timeout issues or my thread being killed because of lack of machine resources.

在这一点上我只是在寻找一个更好的方式来处理这个建议,或者如果循环遍历SmtpClient是一个不错的解决方案,我应该如何去做处理,以prevent我张贴以上。

At this point I'm just looking for suggestions of a better way to handle this, or if looping over SmtpClient is an ok solution, how I should go about handling it to prevent what I posted above.

请问一个Web服务是一种更好的选择?

Would a web service be a better alternative?

请指教,
TIA

Please advise, TIA

推荐答案

我的建议是批了这一点。不要尝试运行ASP.NET code创建20K的电子邮件和送出去,你一定会runinto超时和性能问题。相反,填充收件人,主题,正文表,并从一个窗口服务开始批量生产。这样你的code是一种滞后的地方可以管理执行的,而不是有一个网页,等待请求返回。

My suggestion would be to batch this out. Do not try to run ASP.NET code to create 20K emails and send them out as you are bound to runinto timeout and performance issues. Instead populate a table with recipient, subject, body and begin a batch process from a windows service. This way your code is executed in a way where lag can be managed, instead of having a web page wait for the request to return.

这篇关于发送20000与asp.net电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆