Sending to multiple email addresses but displaying only one C #

I am using SmtpClient in C # and I will send potentially 100 email addresses. I do not want them to go through each of them and send them an individual email.

I know that you can send a message only once, but I do not want the email address from the address to display 100 other email addresses:

Bob Hope; Brain Cant; Roger Rabbit;Etc Etc

Can I send a message once and make sure that only the recipient’s email address is displayed in the element from the email message?

+5
source share
2 answers

- BCC (Blind Carbon Copy)?:)

, SMTP- BCC, :)

, MailMessage Blind Carbon Copy

http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx

http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.bcc.aspx

, MSDN

public static void CreateBccTestMessage(string server)
        {
            MailAddress from = new MailAddress("ben@contoso.com", "Ben Miller");
            MailAddress to = new MailAddress("jane@contoso.com", "Jane Clayton");
            MailMessage message = new MailMessage(from, to);
            message.Subject = "Using the SmtpClient class.";
            message.Body = @"Using this feature, you can send an e-mail message from an application very easily.";
            MailAddress bcc = new MailAddress("manager1@contoso.com");

                //This is what you need
                message.Bcc.Add(bcc);
                SmtpClient client = new SmtpClient(server);
                client.Credentials = CredentialCache.DefaultNetworkCredentials;
                Console.WriteLine("Sending an e-mail message to {0} and {1}.", 
                    to.DisplayName, message.Bcc.ToString());
          try {
            client.Send(message);
          }  
          catch (Exception ex) {
            Console.WriteLine("Exception caught in CreateBccTestMessage(): {0}", 
                        ex.ToString() );
          }
        }
+11

MailMessage, BCC (Blind Carbon Copy).

MailMessage message = new MailMessage();
MailAddress bcc = new MailAddress("manager1@contoso.com"); 

// Add your email address to BCC
message.Bcc.Add(bcc);
+3

All Articles