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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:37:22+00:00 2026-05-13T22:37:22+00:00

This question is pointless, except as an exercise in red herrings. The issue turned

  • 0

This question is pointless, except as an exercise in red herrings. The issue turned out to be a combination of my idiocy (NO ONE was being emailed as the host was not being specified and was incorrect in web.config) and the users telling me that they sometimes got the emails and sometimes didn’t, when in reality they were NEVER getting the emails.**

So, instead of taking proper steps to reproduce the problem in a controlled setting, I relied on user information and the "it works on my machine" mentality.
Good reminder to myself and anyone else out there who is sometimes an idiot.


I just hit something I think is inconsistent, and wanted to see if I’m doing something wrong, if I’m an idiot, or…

MailMessage msg = new MailMessage();
msg.To.Add("person1@example.com");
msg.To.Add("person2@example.com");
msg.To.Add("person3@example.com");
msg.To.Add("person4@example.com");

Really only sends this email to 1 person, the last one.

To add multiples I have to do this:

msg.To.Add("person1@example.com,person2@example.com,person3@example.com,person4@example.com");

I don’t get it. I thought I was adding multiple people to the To address collection, but what I was doing was replacing it.

I think I just realized my error — to add one item to the collection, use
.To.Add(new MailAddress("person@example.com"))

If you use just a string, it replaces everything it had in its list.
Other people have tested and are not seeing this behavior. This is either a bug in my particular version of the framework, or more likely, an idiot maneuver by me.**

Ugh. I’d consider this a rather large gotcha! Since I answered my own question, but I think this is of value to have in the Stack Overflow archive, I’ll still ask it. Maybe someone even has an idea of other traps that you can fall into.

  • 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-13T22:37:22+00:00Added an answer on May 13, 2026 at 10:37 pm

    I wasn’t able to replicate your bug:

    var message = new MailMessage();
    
    message.To.Add("user@example.com");
    message.To.Add("user2@example.com");
    
    message.From = new MailAddress("test@example.com");
    message.Subject = "Test";
    message.Body = "Test";
    
    var client = new SmtpClient("localhost", 25);
    client.Send(message);
    

    Dumping the contents of the To: MailAddressCollection:

    MailAddressCollection (2 items)
    DisplayName User Host Address

    user example.com user@example.com
    user2 example.com user2@example.com

    And the resulting e-mail as caught by smtp4dev:

    Received: from mycomputername (mycomputername [127.0.0.1])
         by localhost (Eric Daugherty's C# Email Server)
         3/8/2010 12:50:28 PM
    MIME-Version: 1.0
    From: test@example.com
    To: user@example.com, user2@example.com
    Date: 8 Mar 2010 12:50:28 -0800
    Subject: Test
    Content-Type: text/plain; charset=us-ascii
    Content-Transfer-Encoding: quoted-printable
    
    Test
    

    Are you sure there’s not some other issue going on with your code or SMTP server?

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

Sidebar

Ask A Question

Stats

  • Questions 345k
  • Answers 345k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Something like $("yourelementselector").live("click", function(){ // your code return false; //… May 14, 2026 at 5:53 am
  • Editorial Team
    Editorial Team added an answer When you say meant to be stored locally Do you… May 14, 2026 at 5:53 am
  • Editorial Team
    Editorial Team added an answer I found why... The solution is to set vertical align… May 14, 2026 at 5:53 am

Related Questions

From what I've seen in the past, StackOverflow seems to like programming challenges, such
I want to create a 100% object oriented framework in PHP with no procedural
This is my 3rd thread concerning a blowfish problem in C#.Despite the fact I
Is there a simple, efficient weak/guarded pointer? I need multiple pointers to the same
Background I have two select form fields chained together: duration and frequency. When the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.