Microsoft.Protocols.TestSuites.MS_ASEMAIL.TestSuiteHelper.CreatePlainTextMime C# (CSharp) Method

CreatePlainTextMime() static private method

Create a sample plain text mime
static private CreatePlainTextMime ( string from, string to, string cc, string bcc, string subject, string body, string sender = null, string replyTo = null ) : string
from string The from address of mail
to string The to address of the mail
cc string The cc address of the mail
bcc string The bcc address of the mail
subject string The subject of the mail
body string The body content of the mail
sender string The sender of the mail
replyTo string The replyTo of the mail
return string
        internal 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 Common.FormatString(plainTextMime, from, to, subject, body);
        }