aspNetEmail

EmailMessage.ForceHeaderEncoding Property

Forces headers to be encoded, even if all of the characters in the header are an ascii value less than 127.

public bool ForceHeaderEncoding {get; set;}

Remarks

According to the RFC standards, headers that only contain ASCII characters do not need to be encoded. For force encoding of all headers, regardless if they are only ASCII characters, set ForceHeaderEncding = true

By default, ForceHeaderEncoding = false

Example

[C#]
		EmailMessage msg = new EmailMessage( "mail.MyCompany.com" ); 
		msg.FromAddress = "me@MyCompany.com"; 
		msg.To = "you@YourCompany.com"; 
		msg.AddHeader( "X-Organization", "MyCompany.com" );
		msg.ForceHeaderEncoding = true;
		msg.Subject = "Daily Newsletter"; 
		msg.Body = "Here is our daily newsletter....."; 
		msg.Send();
		
[Visual Basic]
		Dim msg As New EmailMessage("mail.MyCompany.com")
		msg.FromAddress = "me@MyCompany.com"
		msg.To = "you@YourCompany.com"
		msg.AddHeader( "X-Organization", "MyCompany.com" )
		msg.ForceHeaderEncoding = True
		msg.Subject = "Daily Newsletter"
		msg.Body = "Here is our daily newsletter....."
		msg.Send()
		

See Also

EmailMessage Class | aspNetEmail Namespace