Verifies that all newline characters (13) have are preceded by a carriage return (10). Also checks headers to be sure they do not have newline characters in them.
According to the SMTP RFC’s, all newline characters (ASCII value 10) must have a carriage return character first (ASCII value 13).
By default, CheckNewLines is set to true. There is a small performance hit by having CheckNewLines set to true, because the entire email will have to be verified.
If you know every newline actually consists of a ASCII(13) and ASCII(10) characters, CheckNewLines may be set to false for additional speed. However, this is not recommended, because if the email is not correct, it may be rejected by some recieving mail servers.
The CheckNewLines property will also check the header values to verify newlines do NOT exist in the header values. According to the RFCs, ASCII(13) and ASCII(10) are not permitted in the headers, as this will prematurely split the body of the message.
[C#]
EmailMessage msg = new EmailMessage( "Mail.MyCompany.com" );
msg.FromAddress = "me@MyCompany.com";
msg.To = "you@YourCompany.com";
msg.Subject = "Daily Newsletter";
msg.CheckNewLines = false;
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.Subject = "Daily Newsletter"
msg.CheckNewLines = False
msg.Body = "Here is our daily newsletter....."
msg.Send()