Setting RTF body content in v 18

Hi,
We are upgrading from an older version of aspose email. In the past this is how we included RTF format content in the email body. What is the best way to do the same in v18.x?

Dim msg As MailMessage = New MailMessage()

Dim mapiMsg As Outlook.MapiMessage = New Outlook.MapiMessage()
mapiMsg.BodyRtf = sEmailBody
Dim mi As Aspose.Email.Outlook.MailMessageInterpretor = Outlook.MailMessageInterpretorFactory.Instance.GetIntepretor(mapiMsg.MessageClass)
msg.Body = mi.Interpret(mapiMsg).HtmlBody
msg.IsBodyHtml = True

Thanks.

@Jaideep,

Thank you for contacting Aspose support team.

Please give a try to the following sample code using latest version Aspose.Email for .NET 18.3 and share the feedback.

//Dim msg As MailMessage = New MailMessage()
MailMessage msg = new MailMessage();
//Dim mapiMsg As Outlook.MapiMessage = New Outlook.MapiMessage()
MapiMessage mapiMsg = new MapiMessage();
//mapiMsg.BodyRtf = sEmailBody
var sEmailBody = File.ReadAllText("Rtf.txt");
mapiMsg.SetBodyContent(sEmailBody, BodyContentType.Rtf);
//Dim mi As Aspose.Email.Outlook.MailMessageInterpretor = Outlook.MailMessageInterpretorFactory.Instance.GetIntepretor(mapiMsg.MessageClass)
msg = mapiMsg.ToMailMessage(new MailConversionOptions() { });
//msg.Body = mi.Interpret(mapiMsg).HtmlBody
msg.Body = mapiMsg.BodyHtml;
//msg.IsBodyHtml = True
msg.IsBodyHtml = true;
msg.Save("output.msg", MsgSaveOptions.DefaultMsgUnicode);

output.zip (1.4 KB)
Rtf.zip (8.1 KB)

Thanks,
That seemed to have worked. Need to do some additional testing to confirm.

@Jaideep,

Thank you for the feedback. Feel free to write us back if you have any other query.