Demos for using CleverComponents and TRichView
TRichView (c) Sergey Tkachenko
http://www.trichview.com
Clever Components (c) Clever Components Team
http://www.clevercomponents.com


------ Demos ------

1) Demo1: shows how to send email from the given TRichViewEdit control.

2) Demo2: shows how to send email using a mail editing dialog
Requires RichViewActions compiled with support of CleverComponents, see http://www.trichview.com/help-actions/clevercomponents.htm

3) MailClient: a basic yet full functional email client. 
Requires RichViewActions compiled with support of CleverComponents, see http://www.trichview.com/help-actions/clevercomponents.htm
This demo also uses THTMViewer and TRvHtmlViewImporter components for reading HTML
* THTMLViewer, free component:
- http://code.google.com/p/thtmlviewer/ (current version)
- http://www.pbear.com/ (original version)
- http://www.songbeamer.com/delphi/ (original version ported to Delphi 2009)
* TrvHtmlViewImporter, free component, www.trichview.com/resources/


------ Units ------

1) clRVSendMail.pas, contains:

procedure SendHTMLEmail(RV: TCustomRichView; Smtp: TclSmtp; Msg: TclMailMessage;
  HTMLKind: THTMLKind = htmlAdvanced; Attachments: TStrings = nil);
This procedure sends a message. The message body is in RV, other fields ("From", "To", "Subject") are in Msg.
The message is send using Smtp. You can provide an optional list of attached files.
If HTMLKind = htmlSimple, a basic HTML is used.
If HTMLKind = htmlAdvanced (recommended), HTML with CSS is used.

2) clRVSendDialog.pas, contains:

function ComposeAndSendHTMLEmail(Smtp: TclSmtp; Msg: TclMailMessage;
  HTMLKind: THTMLKind = htmlAdvanced): Boolean;
It shows a dialog for editing email and sends email using Smtp and Msg.
"From", "To", "Subject" of e-mail are initialized using the corresponding properties of Msg.

3) clRVSendDialogEx.pas, contains:

procedure ViewHTMLEmail(MailSource: TStrings);
function EditHTMLEmail(MailSource: TStrings;
  HTMLKind: THTMLKind = htmlAdvanced): TMessageEditResult;
function ReplyToHTMLEmail(MailSource: TStrings; HowToReply: TMessageReplyKind;
  const From: String; HTMLKind: THTMLKind = htmlAdvanced;
  MaxLineLength: Integer = 80): TMessageEditResult;

where
  TMessageReplyKind  = (mekEdit, mekReply, mekReplyToAll, mekForward);
  TMessageEditResult = (meCancel, meSave, meSend);

  ViewHTMLEmail() displays the specified email.
  EditHTMLEmail() opens a window for editing the specified email.
  ReplyToHTMLEmail() opens a window for editing the specified email, or
    forwarding it, or replying to it, depending on HowToReply parameter.

  Parameters:
    MailSource - email source, this is clMailMessage.MessageSource.
    MaxLineLength is used to break lines when quoting text for replying or
    forwarding.

  This unit uses THTMLViewer and TrvHtmlViewImporter, see above.