aspNetEmail

EmailMessage.CharSetHeader Property

Set a Custom Character set used in header encoding, according to RFC2047.

public string CharSetHeader {get; set;}

Remarks

The default is US-ASCII. By default, when the Charset is changed, the CharSetHeader is changed to this value. To use a different CharSet, in the header, than is used in the email body, EmailMessage.CharSetHeader MUST BE SET AFTER EmailMessage.CharSet. This will allow the body of the email to be sent with a different CharSet than the header charset. This setting is for provided for advanced email programmers.

Example

[C#]
		EmailMessage msg = new EmailMessage( "mail.MyCompany.com" );
		msg.FromAddress = "me@MyCompany.com";
		msg.To = "you@YourCompany.com";
		msg.CharSet = "big5";
		msg.CharSetHeader = "ISO-8859-1";
		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.CharSet = "big5"
		msg.CharSetHeader = "ISO-8859-1"
		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