Question

I'm trying to create a mail message using some RTF text as the mail.body, but there's no IsRtfBody property on System.Net.Mail.MailMessage only IsHtmlBody. The test-mails I've received all contain

{\rtf1\deff0{\fonttbl{\f0 Times New Roman;}{\f1 Verdana;}}{\colortbl\red0\green0\blue0 ;\red0\green0\blue255 ;}{\*\listoverridetable}{\stylesheet {\ql\cf0 Normal;}{\*\cs1\cf0 Default Paragraph Font;}{\*\cs2\sbasedon1\cf0 Line Number;}{\*\cs3\ul\cf1\ulc1 Hyperlink;}}\sectd\pard\plain\ql{\f1\fs20\cf0 Beste }{ etc...

I'm pretty sure that it can be done since outlook has the RTF option also, but can't find any suitable examples online, this is what I have so far :

        System.Net.Mail.MailMessage oMessage = GetMailMergeMessage();

        oMessage.Subject = this.MailMerger.Subject;
        oMessage.Body = this.MailMergeResult.RtfText;
        oMessage.IsBodyHtml = true; 

        oMailer.Send(oMessage);

Hope someone can help me,
Jurjen.

Was it helpful?

Solution

Nope, it can't be done.

Also, Outlook does not send just normal RTF as a body. What it does, is encapsulate the RTF content inside of a TNEF message.

Also, the RTF is a special kind of compressed RTF. It is not just normal RTF like you are looking at.

The only way to do this, would be to compress the RTF to MS standards, encapsulate it in a TNEF message, and then attach it as a winmail.dat attachment.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top