Building a bulk mail sender [closed]

泪湿孤枕 提交于 2019-11-30 07:41:32
Tigraine

I think it's not that difficult to roll something like that on your own. It would take a day or so to build. But you should be much better off using something existing.

Still, some things I found important when doing Bulk-Email:

Don't use your own SMTP to send those.

Lookup the MX entries for your recipients and connect the SMTPClient to their SMTP, this gives you the benefit that you get an instant error msg back when the mailbox is not found or something else is wrong, and you don't stress your own server.

There was also a little bug in SmtpClient that gave me trouble because the hostname isn't a fully qualified domain name (as requested by the SMTP spec) but the machine name (and that's an internal field inside SmtpClient). Some SMTP servers take that seriously and want a domainname instead, so I ended up setting that field with reflection to a FQDN. (Hopefully this was changed since)

First off get a component to do the heavy lifting. I would recommend: aspnetmail

Then setting up bulkmailing is as easy as downloading some example code.
WebMailer: Sending 1000s of emails from a web page without timing out.

The same vendor also supplies mx record checker / bounce mail checkers etc. This solution isn't free but the time you save not chasing bugs / inconsistencies in the standard mail component will make this worth your while.

Oh and if you want a bulk mailer which sits on the desktop that is also supplied: http://www.aspnetemail.com/rapidmailer/

gonegonegone

The question is not precise enough but I will attempt to answer it anyway. There are a few factors limiting you're options. The best "way" is really up to your circumstances. What deadline are you working against?

Implementing a large, low-level, multi-threaded mail-sending system will take a lot of time compared to the other option you mentioned. Sure, writing the whole thing from scratch is far more elegant than using the SMTP server and the .NET library for sending the mails.

There is also the matter of the bandwidth between the different data. Will the .NET app and the database be running on the same server as the SMTP? If not, how will the pipeline of bandwidth limit the maximum of mails sent per second?

Personally I am a big fan of keeping it simple. Reusing available software is a smart move if the clock is ticking. How often will you be sending thousands of mails? That interval will define if the time frame is sensible or not. Is it so small that you could end up with the system still working on the first "batch" when another version is ready to be sent out?

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!