How to send email to multiple recipients in C# with System.Net.Mail
Codemia Knowledge Hub ·
To send one email to several recipients with System.Net.Mail, add each address to the MailMessage.To collection and call Send once. The rest is getting the details right: valid addresses, SMTP configuration, exception handling, and whether some recipients belong in Cc or Bcc.
Add each recipient to MailMessage.To
Each call to To.Add appends another recipient:
Send the message
Configure the SMTP client and send:
If the SMTP settings are correct, the message goes to every address in To.
Add recipients from a list
When addresses come from configuration or user input, loop over them instead of hard-coding To.Add calls:
Cc and Bcc work the same way
CC and Bcc are also collections:
Tois for direct recipients.Ccis for visible copied recipients.Bccis for hidden copied recipients.
Picking the right one matters in bulk or compliance-sensitive mail, where recipient privacy counts.
Handle send errors explicitly
Sending can fail because of bad credentials, invalid addresses, SMTP server rejection, DNS issues, or TLS misconfiguration. Catch the exceptions so failures are visible instead of silently losing mail:
Dispose the message and client with using
MailMessage and SmtpClient are disposable, so scope them with using. Cleanup then happens even if an exception is thrown:
Clean up recipient input and add display names
Trim and validate addresses that come from user input:
Pass a MailAddress when you want explicit parsing or a display name:
Is SmtpClient still a good choice?
System.Net.Mail.SmtpClient still exists and works, so it is fine for learning how multi-recipient mail works in .NET. Many developers prefer newer libraries for more advanced workflows, but the address-handling model is the same idea: populate the address collections correctly rather than calling Send many times.
Mistakes to avoid
- Concatenating several addresses into one malformed string instead of adding them to the collection.
- Mixing up
To,Cc, andBccwhen recipient privacy matters. - Skipping exception handling, which leaves you unable to tell whether the server rejected the message or the code failed before sending.
- Wrong SMTP host, port, credentials, or SSL settings. Multi-recipient logic is irrelevant if the transport is misconfigured.
Related reading
- How to serialize a nullable int without xsinil being added to the resulting XML?
- How to serialize an Exception object in C?
- How to set a TextBox for password input in WinForms?
- How to set and change the culture in WPF
- How to set Column Type when using EPPlus
- How to set conditional breakpoints in Visual Studio?
- How to set HTTP status code from ASP.NET MVC 3?
- How to set kubernetes secret as as connection string password in .NET Core?

OOD Fundamentals
Master object-oriented design from first principles, SOLID, design patterns, and classic interview problems with hands-on coding.
View the courseData Structures & Algorithms practice on Codemia
Step through 300+ coding interview problems with animated visualisers that show the data structure changing as the code runs. The Blind 75 are free.