Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending Mail via SMTP in C# using BCC without TO

Tags:

People also ask

What is SMTP in C#?

The standard approach to send an email using C# is SMTP (Simple Mail Transfer Protocol). It is a network protocol used to send emails over the internet.

How do I use SMTP protocol?

Submission of Mail: After composing an email, the mail client then submits the completed e-mail to the SMTP server by using SMTP on TCP port 25. Delivery of Mail: E-mail addresses contain two parts: username of the recipient and domain name.

Is SmtpClient obsolete?

The SmtpClient type is obsolete on some platforms and not recommended on others; for more information, see the Remarks section.


I am trying to use the System.Net.Mail.MailMessage class in C# to create an email that is sent to a list of email addresses all via BCC. I do not want to include a TO address, but it seems that I must because I get an exception if I use an empty string for the TO address in the MailMessage constructor. The error states:

ArgumentException
The parameter 'addresses' cannot be an empty string.
Parameter name: addresses

Surely it is possible to send an email using only BCC as this is not a limitation of SMTP.

Is there a way around this?