Stmp Content Type

Oct 26, 2009 at 11:02 AM

Hi,

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

How can I do that ?

 

Thanks !

Coordinator
Nov 2, 2009 at 1: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 = yourmailaddress@csharpmail.com;
        mg.To = sendmailaddress@csharpmali.com;
        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";
        mg.Contents.Add(ct);

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

Hope your help!