Stmp Content Type

Oct 26, 2009 at 10:02 AM


I have not found in the documentation the way to switch to text/html for smtp.

How can I do that ?


Thanks !

Nov 2, 2009 at 12:31 AM

You can create html mail with SmtpContent object.

------Sample code start--------------------------------------------------

        mg = new SmtpMessage();
        mg.Subject = "Hi it's html mail";
        mg.From =;
        mg.To =;
        mg.Date = DateTime.Now;
        mg.HeaderTransferEncoding = TransferEncoding.Base64;
        mg.ContentTransferEncoding = TransferEncoding.Base64;
        ///Create html mail with smtp content object
        ct = new SmtpContent();
        ct.ContentTransferEncoding = TransferEncoding.Base64;
        ct.BodyText = "your html text";
        ct.ContentType.Value = "text/html";

------Sample code end--------------------------------------------------

Hope your help!