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 6785257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:06:17+00:00 2026-05-26T17:06:17+00:00

I am sending emails using c# using SmtpClient. I have to send aproximately one

  • 0

I am sending emails using c# using SmtpClient. I have to send aproximately one hundred different emails per day, and I can’t use the same mail (adding several recipients) since the email changes according to the recipient.

I am not using a local SMTP server, and I understand (according to @rizzle response here)
that some time has to be left between one mail and another one. However, I am sleeping my program for 10 seconds and still, it is only the first email that gets sent, never the second one (so far I am trying my system with two emails instead of one hundred). This is my code, any ideas?

foreach (Person p in clientList)
            {
                AlternateView plainView = AlternateView.CreateAlternateViewFromString("Texto visible para clientes que no tienen HTML", null, "text/plain");
                //AlternateView htmlView = AlternateView.CreateAlternateViewFromString("Here is an embedded image.<img src=cid:companylogo>", null, "text/html");

                string htmlString = "html string body of the email";
                AlternateView htmlView = AlternateView.CreateAlternateViewFromString(htmlString, null, "text/html");

                System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
                message.AlternateViews.Add(htmlView);
                message.To.Add(p.email.Trim());
                message.Subject = p.nombre+", email subject";
                message.From = new System.Net.Mail.MailAddress(fromAddress);
                System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("...");
                NetworkCredential myCreds = new NetworkCredential(usr, pass, "");
                client.Credentials = myCreds;
                client.Send(message);
                System.Threading.Thread.Sleep(10000);

            }
  • 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-26T17:06:18+00:00Added an answer on May 26, 2026 at 5:06 pm

    Do client.Dispose() right after you send your last message, if you’re on dotnet 4. This will force the dotnet SMTP stuff to finish its work.

    See here: System.Net.Mail and MailMessage not Sending Messages Immediately

    If you’re on earlier versions of DotNet, try doing a couple of things.

    Do message.Dispose() when you’re done with the message instance.

    Define your SmtpClient locally (within a method) and exit the method when you’re done sending. That is, don’t try to keep your client instance around as a field in one of your long-lived class instances; it won’t flush the last message you sent to the server until it’s finalized.

    (They really did fix this in dotnet 4.0)

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

Sidebar

Related Questions

I'm using SMTPClient for sending emails to a SMTP server. But with Send method
When sending email using the SMTPClient class in ASP.NET C#, how can I add
When sending out emails using the SmtpClient and a MailMessage (.net 3.5) the To
Experimented sending secure emails using C# and was wondering if I have understood things
I am sending emails using utl_mail.send(), and it is possible that some of the
Basic question here: I'm sending emails using the default SmtpClient of the .NET framework
Has anyone ever tried sending emails using 1&1 smtp host? I tried the following?
I am using a script that is sending out emails and I am receiving
Hey all. We're sending quite a few emails (around 23k) using IIS6 SMTP service
using the Code Snippet for sending email in VB.Net I have successfully sent an

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.