Rich text in body of mail (mailsocket)

Dear all,

when I paste rich text in the styled text textarea, and I use this as body, the mail I’m sending via the MailSocket, is in plain text.
Is there a way to keep it rich, or to convert it to HTML?

thanks

Gert

How are you assigning the TextArea to the mail body?

I tried both TextAreaMailBody.StyledText.RTFData and TextAreaMailBody.FormattedText

I did a test and I get the RTF code (not the formatted text) on the email and not plain text. Then some searches and found that RTF email is not something that is used regularly, email normally use plain text or html.

Maybe it is better to find or create a StyledText to HTML project/code. I found an old one here, don’t know if/how it works

Edit: Just dragged StyledTextToHTML.rbo to my test app, and used it as:

mail.BodyHTML = TextArea1.StyledText.ToHTML

and it works. It’s great that 13 year old code still works without any change.

Richtext email is not RTF!
Don’t confuse them!

You may need to convert your textarea to either rich text or html text.

Consider using ckEditor. Works great in our Xojo desktop project.

Christian, thank you, a lot to learn. The linked code worked ok with a simply styled TextArea ToHTML.

Joost, I visited ckEditor webpage but I didn’t find what is needed to use with Xojo. I don’t need at this moment, I’ll take a look in the future. Thanks.

Let’s see what Gert needs.

(somehow my reaction of last night did not get posted!)
This is great! Thanks Alberto!

@Joost Rongen – How would that work, Joost? Any XOJO sample code available?

@Gert Van Assche
You can download a Xojo demo from the website Gate61
Demo: Trial Desktop Version - Run, No Build

@Paul Sondervan Impressive as well! Thanks for sharing.