aspNetEmail

EmailMessage.Cc Property

Allows you to easily set the EmailMessage.Cc property of an email without having to use the EmailMessge.AddCc() method.

public string Cc {get; set;}

Remarks

For Example: EmailMessge.Cc = "me@myCompany.com" Using the Cc property, you cannot set the 'Name' of the recipient, only the email address. If you want to use a name, then use the EmailMessage.AddCc( EmailAddress, Name) overloaded method. You can also use commas (,) or semi-colons if you want to use multiple email addresses with the EmailMessage.To property. For example: EmailMesage.Cc = "me@myCompany.com;you@yourCompany.com;him@hisCompany.com"

Example

[C#]
		EmailMessage msg = new EmailMessage( "mail.MyCompany.com" );
		msg.FromAddress = "me@MyCompany.com";
		msg.To = "you@YourCompany.com";
		msg.Cc = "ccHim@HisCompany.com";
		msg.Subject = "Daily Newsletter";
		msg.Body = "Here is our daily newsletter.....";
		if ( msg.Send() )
		{
			Console.WriteLine( "Message Sent!");
		}
		else
		{
			Console.WriteLine( msg.LastException().Message );
		}
		
[Visual Basic]
		Dim msg As New EmailMessage("mail.MyCompany.com")
		msg.FromAddress = "me@MyCompany.com"
		msg.To = "you@YourCompany.com"
		msg.Cc = "her@HerCompany.com"
		msg.Subject = "Daily Newsletter"
		msg.Body = "Here is our daily newsletter....."
		If (msg.Send()) Then
		    Console.WriteLine("Message Sent!")
		Else
		    Console.WriteLine(msg.LastException().Message)
		End If
		

See Also

EmailMessage Class | aspNetEmail Namespace