4

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?

Marshall
  • 1,195
  • 6
  • 30
  • 47
  • 2
    i would hate to contribute to more spam... – Randy Jul 11 '11 at 20:55
  • 1
    You might want to read [this very detailed answer](http://stackoverflow.com/questions/3905734/how-to-send-100-000-emails-weekly/3905805#3905805) about the various problems you have to deal with when sending bulk email. – hammar Jul 11 '11 at 21:20

3 Answers3

2

If you are using Mvc you can take a look at MvcMailer. Seems pretty clean and neat.

sTodorov
  • 5,435
  • 5
  • 35
  • 55
1

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.

CrazyDart
  • 3,803
  • 2
  • 23
  • 29
  • 1.By "email service" you mean sth like internet Sms gateway? Which share functionality via web service? – Marshall Jul 12 '11 at 00:07
  • 2. What's the diffrence between that email service and my own application - which sends emails via System.Net.Mail? I could send spam by email service as well, right? – Marshall Jul 12 '11 at 00:08
  • 3. To send mass sms - I need to use sms gateways (for technical reasons) - and pay them. That's ok. But to send mass email - thare are no technical reasonos to pay somebody to do that. I Want to write that functionality on my own. That application will need only access to internet and server. And these two things has to be deliverd by somebody that will use my application. could you recommend me some good article or a book? If it's a 'bigger' subject? – Marshall Jul 12 '11 at 00:11
  • 4. And last question: I'm only a programmer. Am I really have to worried about SPAM laws ? I don't even know Who is gonna use it. And in which country? – Marshall Jul 12 '11 at 00:11
  • In 1999, all of your perspectives were correct. If you have the programming know how, you could unleash a furry of email from one source. Today, the the email ecosystem is smart enough to identify this very quickly and if you are not on a list of trusted senders... you get shut down. There are a list of companies that specialize in shutting down this activity. You need to contact some of them. No I wont tell you who they are, just do some research. – CrazyDart Jul 12 '11 at 20:52
  • Well, I think you still don't understand me. Like I said, I'm a programmer.. All I need to care about, is the client-side - not a server. I assume that the company (which will use my tool) have a smtp server on the safe list, well configured with all PTR, DKIM, SenderID etc.. things, have a server admin, which will be resposible for server configuration. Not me. I have to care about to code-side, so I think, about bounce-backs, rate-limiting per domain.. i don't know what else. So in my very first question I asked in 4. about System.Net.Mail and sending messages one by one in loop. – Marshall Jul 13 '11 at 00:28
  • And 5) What should I do, to avoid sending emails as a spam? But from the code-side. What is important? For example I read about sending one by one, not using BCC. or dealing with bounce-backs somehow.. – Marshall Jul 13 '11 at 00:31
1

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.

  • 1) Well, I don't really know "how much". I want to create tool, which will be able to send as many email as a company want to. If they want to send spam - they probably be busted. Schedule messages over several periods - it is good idea. But - How many? - Probably that will be a property in configuration section, but what should be the upper limit? and.. yes, In a matter of fact - I want to create a system to handle email creation and sending. – Marshall Jul 11 '11 at 21:34
  • Once again, this is a VERY complex subject. Your questions are like asking "How do I build a rocket to launch to the moon, and how much fuel is too much so I dont blow up?" – CrazyDart Jul 11 '11 at 22:30
  • So, If that is that complex- there must be a good article about it, or a book maybe? Sending mass emails by large companies? – Marshall Jul 11 '11 at 23:42
  • A lot of questions you have are the same as I would have (as a professional developer). Usually you'll find out by testing the system. After testing you can tweak and optimize where neccesary. You cannot find all answers before you start building because, now I understand, you don't know the requirements for your customers. Also, depending on your needs, you'd choose to use a dedicated mail server or perhaps the same server that hosts your web application or so. If you say a customer might abuse your module then you don't want to own (and be partly responsible for) the mail server. – Marino van der Heijden Jul 12 '11 at 09:19
  • I will ask you like that: If I had a super-fast sever, really good internet connection and application, which supports message templating (and other options - which will make my messages flexible) - Is there any sense to pay fees to newsletter systems or emails services? What is their advantage over my solution ? – Marshall Jul 12 '11 at 12:30
  • Its all politics. You may have a jet and unlimited fuel, but thats not going to do you much good when you get shot down over the ocean. If you start sending that much email and you dont have the correct political connections you will soon find yourself (your IPs) blacklisted from all the major mail servers. Trust me, you dont want that. If you are asking this question here, you dont have the correct connections. Its really a security issue. You arnt going to find an article on "How to pump billions of emails to every user on the net and not get stopped by the SPAM police" Its crazy. – CrazyDart Jul 12 '11 at 20:48