AttachmentBase.TransferEncoding Property
.NET Framework 4
Gets or sets the encoding of this attachment.
Assembly: System (in System.dll)
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
dot-stuffing
It appears dot-stuffing (rfc 2821 - 4.5.2 Transparency) is not done when the TransferEncoding is SevenBit, so you have to manually do it or risk losing periods that start a line.
string body = ".test" + Environment.NewLine + "..test" + Environment.NewLine + "...test";
body = System.Text.RegularExpressions.Regex.Replace(body, "^[.]([^\r\n])", "..$1", System.Text.RegularExpressions.RegexOptions.Multiline);
m.AlternateViews.Add(AlternateView.CreateAlternateViewFromString(body));
m.AlternateViews[0].TransferEncoding = System.Net.Mime.TransferEncoding.SevenBit;
string body = ".test" + Environment.NewLine + "..test" + Environment.NewLine + "...test";
body = System.Text.RegularExpressions.Regex.Replace(body, "^[.]([^\r\n])", "..$1", System.Text.RegularExpressions.RegexOptions.Multiline);
m.AlternateViews.Add(AlternateView.CreateAlternateViewFromString(body));
m.AlternateViews[0].TransferEncoding = System.Net.Mime.TransferEncoding.SevenBit;
- 7/15/2011
- Randy Shoopman