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

  • SEARCH
  • Home
  • 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 7522663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:35:13+00:00 2026-05-30T02:35:13+00:00

We have a website and we just ran into a problem when trying to

  • 0

We have a website and we just ran into a problem when trying to send 700 emails in one bulk. I’m thinking it’s better to send 100 emails 7 times but which approach should I take?

  • I could just use a for loop and send an email 7 times but is there any problems with this approach, e.g. if the amount of emails double?
  • Threading, which I’m new to and would take more time.

Here’s my code:

protected void btnClick_Send(object sender, EventArgs e)
{
     MailMessage mailObj = new MailMessage();
     mailObj.Bcc.Add(txtReciever.Text.Trim());
     mailObj.ReplyToList.Add("our-reply-email@oursite.com");
     mailObj.SubjectEncoding = System.Text.Encoding.UTF8;
     mailObj.BodyEncoding = System.Text.Encoding.UTF8;
     mailObj.Subject = txtSubject.Text;
     mailObj.Body += Environment.NewLine;
     mailObj.Body = txtContent.Text;
     mailObj.Body += Environment.NewLine;
     SmtpClient SMTPServer = new SmtpClient();
     SMTPServer.Send(mailObj);
}  

Any other ideas?

  • 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-05-30T02:35:15+00:00Added an answer on May 30, 2026 at 2:35 am

    This is definitely one of those embarrassingly parallel problems, which would gain great benefit from parallelism.

    In .NET 4.0 you can have that code run in parallel by simply using the Parallel.ForEach method.

    Assuming that messages is a sequence of objects containing the Receiver, Subject and Body of the e-mails to send, this example uses the Task Parallel Library to automatically send as many of them as possible out in parallel given the resources available on the machine:

    Parallel.ForEach(messages, message =>
    {
         MailMessage mailObj = new MailMessage();
         mailObj.Bcc.Add(message.Receiver);
         mailObj.ReplyToList.Add("our-reply-email@oursite.com");
         mailObj.SubjectEncoding = System.Text.Encoding.UTF8;
         mailObj.BodyEncoding = System.Text.Encoding.UTF8;
         mailObj.Subject = message.Subject;
         mailObj.Body += Environment.NewLine;
         mailObj.Body = message.Body;
         mailObj.Body += Environment.NewLine;
         SmtpClient SMTPServer = new SmtpClient();
         SMTPServer.Send(mailObj);
    }
    

    Of course, you can implement the same solution in .NET 2.0 as well, for example using the ThreadPool.QueueUserWorkItem method to manually schedule the e-mails to be sent out on different threads, but it would definitely require more effort.

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

Sidebar

Related Questions

I'm trying to create a website for myself and just ran into this issue:
I have a website that I've just uploaded onto the Internet. When I browse
I have a website, and I just discovered that somehow someone injected JavaScript on
I just edited an .SWF file I have on my website home page for
I have a small website developed using VS2005 and mySQl, it's just 2 webforms
I have multiple themes on my website and users can just switch between multiple
We just switched to our new website redesign. We have a copy of the
I have a String with this content: href=http://www.website.com/ /> [...] [...] I just want
Sceanario : I have just finished the design for my website and am currently
I have been implementing AES onto my website for security and I have ran

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.