public static string CreatePlainTextMime(string from, string to, string cc, string bcc, string subject, string body, string sender = null, string replyTo = null)
{
cc = string.IsNullOrEmpty(cc) ? string.Empty : string.Format("Cc: {0}\r\n", cc);
bcc = string.IsNullOrEmpty(bcc) ? string.Empty : string.Format("Bcc: {0}\r\n", bcc);
sender = string.IsNullOrEmpty(sender) ? string.Empty : string.Format("Sender: {0}\r\n", sender);
replyTo = string.IsNullOrEmpty(replyTo) ? string.Empty : string.Format("Reply-To: {0}\r\n", replyTo);
string plainTextMime =
@"From: {0}
To: {1}
"
+ sender + cc + bcc + replyTo + @"Subject: {2}
Content-Type: text/plain; charset=""us-ascii""
MIME-Version: 1.0
{3}
";
return FormatString(plainTextMime, from, to, subject, body);
}