views:

315

answers:

1

Hi,

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.

+1  A: 

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.

Cheers!

Dave

dave wanta
thanks for your reply.As it turns out, the devexpress RichTextControl I'm using also exposes the content as HTML :-) so it works fine now !!
Jurjen