Send an e-mail with rtf text in delphi

后端 未结 3 561
长发绾君心
长发绾君心 2021-01-19 02:52

I would like to perform the following task: converting a TRichEdit content (an rtf text) into a not-plain-text e-mail message body.

MAPI doesn\'t support rtf, but is

相关标签:
3条回答
  • 2021-01-19 03:04

    Indy supports sending RTF emails. Send an email the same way you would send an HTML email, just use the "text/rtf", "text/enriched", or "text/richtext" Context-Type, and send the raw RTF codes that are generated by TRichEdit when its PlainText property is set to false. Also, if you are using Indy 10, look at its TIdMessageBuilderRtf class to set up the TIdMessage structure correctly.

    0 讨论(0)
  • 2021-01-19 03:09

    Is it possible to convert rtf to text using TWebBrowser?

    You can convert RTF to Text using TRichEdit - but obviously this loses all formatting:

    Using TRichEdit at runtime without defining a parent

    2: You can find a number of RTF to HTML converters online - some free, some not. Like these:

    http://wiki.delphi-jedi.org/wiki/JVCL_Help:TJvRichEditToHtml https://www.habarisoft.com/scroogexhtml_delphi.html http://www.easybyte.com/products/rtf2html.html

    http://www.sautinsoft.com/products/rtf-to-html/index.php

    3: You can rename the noname attachment as NONAME.MHT and it should then be openable with internet explorer.

    However you might want to consider using an HTML edit control, rather than a TRichEdit. Then you have no conversion to worry about. Something like this question:-

    WYSIWYG HTML Editor Component for Delphi

    0 讨论(0)
  • Apparently (googled this myself, as I mail some from Delphi, but not in this case), the PR_RTF_COMPRESSED option of (extended) MAPI may help you here. Also look at this.

    0 讨论(0)
提交回复
热议问题