MailMessage.Bcc
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.IO.Compression;
using System.Net;
using System.Net.Mail;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using System.Text;
public class MainClass
{
public static void Main()
{
SmtpClient client = new SmtpClient("smtp.localhost.com");
client.Credentials =new NetworkCredential("username", "password");
MailMessage message = new MailMessage(new MailAddress("joe@net.com", "Joe"), // To
new MailAddress("raj@web.com", "Ray")); // CC
message.Bcc.Add(new MailAddress("a@asdf.com"));
message.Bcc.Add(new MailAddress("m@fda.com"));
message.Subject = "subject";
message.Body = "body";
Attachment att = new Attachment(@"c:\file.cs");
message.Attachments.Add(att);
client.Send(message);
}
}
Related examples in the same category