Sending multiple emails - solutions used in large systems
Previously I asked you about ways to test sending multiple emails at once. Now I would like to ask you about the solutions used in large systems - to send multiple emails at once.
My question is somewhat complex:
1) I'm very curious about solutions which are used now - I mean.. For example, in the banking system. Where sometimes it is necessary to send millions of emails. How the bank-system send multiple emails to clients?
2) Is that possible with simple gmail or hotmail account ?
3) What is necessary to send very large amount of emails ?开发者_运维问答
4) using "System.Net.Mail;" is a good solution? Sending one by one - to all bank clients?
5) What should I do, to avoid sending emails as a spam?
Thanks for help
EDIT:
I know that I can't prove it - but I don't need it for spam. Every large company computer system has to have a tool - which supports messages sending.
It will be 100% legal! I want to create a tool - in configuration client will set his own email server (it could be gmail, hotmail or his own). And connect to his system - For example library or sth like that. When school wants to inform all parents about the event or library.. or maybe something bigger - like a bank.
I will send emails only for test - and I will use probably "Papercut" - but I don't know if it's credible tool.
So, like I said - I just want to know, how it is done in large systems - like bank-systems.
and
My solution for now is to get message and all emails from database and send them one by one, using "System.Net.Mai" - is that a good solution?
If you are using Mvc you can take a look at MvcMailer. Seems pretty clean and neat.
Use an email service. There are many of them around. Even amazon has one as part of their cloud offerings. This is actually a complex subject. You have to comply with SPAM laws allowing people to opt-out of your emails. You also can get your IP address blacklisted. Most ISPs will charge you thousands of dollars if you blacklist one of their IPs.
Many services have an API you can hook into. Most charge per email... but if you are legit you will be able to pay the fees.
UPDATE: If you really think you wont have problems with getting blacklisted, here is what I know. Well technically, if the SMTP is sending to its own trusted mail servers you could use System.Net.Mail. An SMTP server might perform some checks when the sender connects to send, or it might not. Once the message gets routed if the remote server rejects the email for what ever reason (blacklisted, address not found, box full) a rejection email will be sent to the From address. Your network connection on the programming side will be the bottle neck. I would suggest batching the emails. Tuning the batch will be the hard part. You dont want to overwhelm the SMTP server. Start with 5000 email batches with around 3 to 5 min timeout between batches. You dont want your email sender code to be a web app, if the app crashes you will dump all of the unsent emails and not know what you sent. You can either keep track of these in a database or use persistent messages with a message bus system. You will need to watch the send like a hawk, because if your emails start bouncing back you will want to check why before you are in too deep. Make sure the from address is valid, thats important.
There are lots of spam laws now. Look at CANSPAM (http://business.ftc.gov/documents/bus61-can-spam-act-compliance-guide-business). As a programmer you are correct, you don't care about what your client does with the code. As the business person providing this program to your clients you should care that they don't get in trouble with it... remember you are there technical adviser on the subject.
1) "Millions" sounds like spam. But if a banking system sends for eaxample marketing info or security warnings to all of it's customers, it will schedule this over several periods in down-hours (at night most of the time). For this a bank (or any other organization) will use some system to handle email creation and sending.
2) Not sure about gmail and hotmail's policies, but I can guarantee you that you won't be able to send thousands of emails at once.
3) Large systems will use email proxies (trusted smtp servers with authentication) to send large amounts of email.
4) Best way to prevent "stupid mistakes" such as thousands of email addresses listed in the CC... :-)
5) Make sure the recipients have opted-in for email. In other words, they agreed to recieve your email.
精彩评论