5

One of our problems is that our outbound email server sucks sometimes. Users will trigger an email in our application, and the application can take on the order of 30 seconds to actually send it. Let's make it even worse and admit that we're not even doing this on a background thread, so the user is completely blocked during this time. SQL Server Database Mail has been proposed as a solution to this problem, since it basically implements a message queue and is physically closer and far more responsive than our third party email host. It's also admittedly really easy to implement for us, since it's just replacing one call to SmtpClient.Send with the execution of a stored procedure. Most of our application email contains PDFs, XLSs, and so forth, and I've seen the size of these attachments reach as high as 20MB.

Using Database Mail to handle all of our application email smells bad to me, but I'm having a hard time talking anyone out of it given the extremely low cost of implementation. Our production database server is way too powerful, so I'm not sure that it couldn't handle the load, either. Any ideas or safer alternatives?

Samantha Branham
  • 7,350
  • 2
  • 32
  • 44

2 Answers2

1

All you have to do is run it through an SMTP server and if you're planning on sending large amounts of mail out then you'll have to not only load balance the servers (and DNS servers if you're planning on sending out 100K + mails at a time) but make sure your outbound Email servers have the proper A records registered in DNS to prevent bounce backs.

It's a cheap solution (minus the load balancer costs).

j0k
  • 22,600
  • 28
  • 79
  • 90
  • Could you elaborate? Do you mean host an SMTP server on our LAN and use that? Would spam filtering be a concern? We send what I would consider a low volume of email, but do often send large attachments, so I'm not sure load balancing would be worth the cost. – Samantha Branham Oct 16 '12 at 20:52
0

Yes, dual home the server for your internal lan and the internet and make sure it's an outbound only server. Start out with one SMTP server and if you get bottle necks right off the bat, look to see if it's memory, disk, network, or load related. If its load related then it may be time to look at load balancing. If it's memory related, throw more memory at it. If it's disk related throw a raid 0+1 array at it. If it's network related use a bigger pipe.

  • I'm a pretty crappy network/server administrator. Our actual networking/server administration guy says that recipients may block our emails since they would not be able to do a reverse lookup of our SMTP server. I don't really know what that means, but I'm looking into it. Also, welcome to StackOverflow! It's a better idea to just edit your original answer instead of posting a new answer to answer a follow-up question. – Samantha Branham Oct 16 '12 at 21:52
  • Tell your network administrator that with properly configured DNS records, that won't be an issue. – Techie Joe Oct 16 '12 at 22:30
  • He says our domain already points to a mail server (its not our own) and that we would need to use a subdomain or something weird to have a second one. – Samantha Branham Oct 17 '12 at 12:51
  • That's the idea (using a subdomain). It has to be a standalone installation for your SQL server only. – Techie Joe Oct 17 '12 at 15:56