Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8701705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:27:57+00:00 2026-06-13T02:27:57+00:00

We are interested in implementing something into our ASP.NET web application that will send

  • 0

We are interested in implementing something into our ASP.NET web application that will send out an e-mail to addresses pulled from SQL Server 2008.

This doesn’t seem like it would be that difficult. Pseudo-code:

EmailAddressList addresses = EmailAddressManager.GetList();

foreach (EmailAddress x in addresses)
{
    MailMessage msg = new MailMessage("fromaddress@test.com", x.ToAddress);
    //prepare msg, body, subject, etc.

    SmtpClient smtp = new SmtpClient();
    smtp.Send(msg);

    //add artificial delay for throttling?  this seems to be a common tactic
}

This question has an upvoted comment that links to something that was supposedly helpful, but now just leads to a Page Not Found error.

And in this question, the OP says specifically that the above pseudo-code method isn’t “the good way.” But what is wrong with it? Is there a common or better practice for this? Are there hidden pitfalls I’m not taking into account?

And just a little bit more detail about our situation: this will only be used maybe twice per month, and the number of emails to be sent at once will not be above roughly 30 or 40. The end goal is, we go to this page that has this tool, we can preview what’s going to get sent out and to who, and then we just press a button and it executes the above pseudo-code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:27:58+00:00Added an answer on June 13, 2026 at 2:27 am

    I don’t think there’s anything wrong with a loop like you’re doing, but there are a few things you probably need to handle. The most important would probably be error handling. If one of the emails fails, you’ll just break out having sent emails to a subset of people, and it’ll be tough to deal with should you need to send to the rest. Even if you have some simple try-catch, you’ll still have a problem retrying those emails. You’ll want to have some way of storing all the emails you planned on sending to and the results of each send.

    Next will be performance-related. Sending emails one at a time using .Send() is going to be slow if it’s a lot of emails. An easy way around it is to use the Task library or the Async version to multithread the sends. Of course this makes the state management a little more complicated, but it will improve email sending speed significantly. If you have a limit to the number of emails you can send per minute/hour, then that may or may not be at odds with this optimization.

    If you have different content for each recipient you’ll probably want to use some templating library like NVelocity or the MS Razor Engine.

    Or you could just outsource this boring stuff to somewhere like SendGrid.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm implementing form dirtiness detection for a web-app. The 'dirtiness' that I'm interested in
I'm interested in implementing something like the combobox used in GMail to easily select
I am interested in implementing C2DM for the push notification feature in my application.
I'm interested in implementing a Favorites Bar in my Cocoa application in the same
Im interested in implementing a JQuery solution for a Panel Selector that seems very
I'm currently poking around with a new archive format and was interested in implementing
I am interested in logging all traffic that comes over port 443 for trouble-shooting
I'm very interested in learning about the new feature in HTML5 called web sockets.
I'm looking at implementing an RDBMS. Are there any good resources out there about
In the application I'm building, the user may perform something in one view (backed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.