EmailMessage.BodyEnriched

My application is running in macOS 10.12.6
I am working with XOJO Version 2017 Release 2

I try to send an email in enriched text format (RTF). I assign TextArea1.StyledText.RTFData to EmailMessage1.BodyEnriched.

[code]dim Email as new EmailMessage

email.FromAddress = iv_sender
email.Subject = iv_subject
email.BodyEnriched = TextArea1.StyledText.RTFData
[/code]

Into the mail app I get always something like this:

{\\rtf1\\ansi\\ansicpg1252{\\fonttbl{\\f0\\fnil .AppleSystemUIFont;}}{\\colortbl\\red0\\green0\\blue0;}\\uc0 \\f0\\fs26 This is a test}

What must I do to get the enriched text without the control characters?

BodyEnriched is not RTF!

it’s a different standard.

What can I do?
The language reference for EmailMessage.BodyEnriched shows as example

// populate the email message mail = New EmailMessage mail.FromAddress = "mary@company.com" mail.Subject = "Status Report" mail.BodyEnriched = MailText.StyledText.RTFData

Sorry, that is wrong.

See
http://en.wikipedia.org/wiki/Enriched_text

Vielen Dank, Christian! Gibt es den Link auch in deutsch?

Nur Spanisch und Swedish sind noch im Angebot.
Aber so schwer ist das nicht.

Fetter Text

Sieht schwer dem alten html hnlich.

Ich überlege noch wie ich damit umgehe. Der Aufwand für einen “RTF-zu-Enriched-Text-Konverter” könnte ja recht hoch werden.

Da braucht es doch nur eine Schleife über die styleRuns und ein paar Status Variablen.

Wenn fett anfängt ein rein und wenn es aufhört ein rein. Gleiches für andere Tags.

That idea I have had too. But I doesn’t work.
I’ve tested the following example:

Email.BodyEnriched   = "<bold>Hello, <italic>world!</italic></bold>"

In the e-mail isn’t anything bold or italic.

Mu es denn unbedingt RTF sein? Hast Du schon berlegt, ob Du aus dem TextArea ein Html machen knntest? Das geht dann ganz einfach in die Mail.

textutil auf dem Mac knnte RTF in Html umwandeln. Ja, hier ist es:

textutil -convert html foo.rtf

 converts foo.rtf into foo.html

HTML habe ich noch nicht ausprobiert, TEXTUTIL auch noch nicht. Werde es aber versuchen.

Die E-Mail setze ich aus einer APP ab, die RTF-Text beinhaltet. Da möchte ich natürlich die Formatierungen erhalten, so daß der Text in der APP und der E-Mail identisch aussehen.

Either the documentation is buggy or the BodyEnriched feature. I’ve opened a case: #49434