Send richedit email with ipworks

Good afternnon to all,
in one of yours blog you teach how is possible send a richedit email (with or without attachment) with only one code line.
In the demo the componet used is TAdvRichEditorEmailIO that has a procedure defined as

GenerateEmail(idMessage: TIdMessage; ImgPath: string = ''); virtual;

Now, it's possible have the same procedure that works with ipworks component (TipwHTMLMailer or TipwSMTP ) and not only for indy ?

Thank you for reply

Best regards


PS: ipWorks is delivered with delphi 10.4 and delphi 11 with getit

We will need to allocate time for this.
Add this as a feature request TMS Software | Support and when there is demand, we'll look at it.

Hi Bruno,
using ipWorks library send an emial with rich text (with embedded image(s)) and attached file is very very easy.
Not with only one code line but .... not complex.
In case someone has my need here the part of code needed to do this:
Assuming to have a TAdvRichEditor, TAdvRichEditorHTMLIO and TipwHTMLMailer (ipWorks component).

When the Send button is pressed this is the code:

// Save rich text (html text) to a file
// Load Text file to a string list
// Copy the stringlist text to a string 
// For this component The string "file:// " must be removed
 while Pos('file://',S)>0 do
// Set the new string and save again

// Setting htmlMailer With name and so on ...
TipwHTMLMailer.MailServer:=SMTP MailServer;
TipwHTMLMailer.MailPort:=SMTP Port;
TipwHTMLMailer.User:=Server UserName;
TipwHTMLMailer.Password:=Server Password

// IMPORTANT This must be ''
// Because with this line the html file is loaded and
// MessageHTML is filled with the appropriate string.
// If is not empty, the file is APPEND to MessageHTML
TipwHTMLMailer.HTMLFile:= FileName;

// In case of attachment what is need is the full filename
// this can be done with a StringList
If TStringList.Count>0 then
   For I:=0 To TStringList.Count - 1 Do

// Send all ....

// Done ...

This can be optimized (write in better code).

Hope this can be useful.

Best regards


1 Like