trichview.com Forum Index trichview.com
TRichView support forums
 

Making HTML email client with CleverComponents

Goto page 1, 2  Next
 
Post new topic   Reply to topic    trichview.com Forum Index -> Announcements
    View previous topic :: View next topic  
Author Message
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 12877

PostPosted: Sun Sep 12, 2010 9:45 am    Post subject: Making HTML email client with CleverComponents Reply with quote

The Clever Internet Suite ( http://www.clevercomponents.com ) represents 100% Delphi VCL components for Borland Delphi / C++Builder, with no external dependencies.
These components allow you to send and receive mail, including HTML and MIME attachments, from within an application, download and upload Internet resources over most popular protocols.


This file contains several useful functions allowing using TRichViewEdit as an editor for HTML emails:
(the link removed is, see the comments at the and of this message)
The units use CleverComponents for sending, receiving and parsing HTML emails.
The units include functions for:
  • sending HTML email composed in TRichViewEdit control;
  • displaying a dialog window for creating a new HTML email (allowing to compose email with rich text, images, attachments); email is sent after closing this dialog window;
  • displaying the same dialog for viewing email (in read-only mode)
  • displaying this dialog for replying to or forwarding email.

The dialog uses RichViewActions ( http://www.trichview.com/resources/actions/ )
The functions that need reading existing HTML emails (viewing, forwarding, replying) uses TrvHtmlViewImporter ( http://www.trichview.com/resources/#components )

Three demo projects are available:
  • Sending email from TRichViewEdit control
  • Sending email using a dialog window
  • Basic but full functional email client

Compiled demo of this email client:
http://www.trichview.com/resources/clevercomponents/clevermailclient.zip

Screenshot:


Updates:
2012-Dec-25: fix for attached images (see the discussion below); compatibility with TRichView 14.
2013-Jul-7: RVAContolPanel is placed on the mail editing form and assigned to all actions explicitly
2016-Aug-9: updated for compatibility with newer version of CleverComponents
2016-Nov-8: link to source code is removed, because it is included in the installer of TRichView (ThirdParty\CleverComponents\Demos\ folder)


Last edited by Sergey Tkachenko on Tue Nov 08, 2016 11:52 am; edited 4 times in total
Back to top
View user's profile Send private message Visit poster's website
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 12877

PostPosted: Tue Oct 18, 2011 7:06 pm    Post subject: Reply with quote

Updated:
- corrections in processing attached images
- using the latest (googlecode's) version of THTMLViewer for loading HTML emails (a code working with older version is not removed but commented)
Back to top
View user's profile Send private message Visit poster's website
bilgin



Joined: 26 Nov 2012
Posts: 2

PostPosted: Mon Nov 26, 2012 9:06 pm    Post subject: Compiled demo is not working correctly ! Reply with quote

Hi

i've downloaded

http://www.trichview.com/resources/clevercomponents/clevermailclient.zip

and faced strange problem..your demo can create and post html message with image embedded/attached but it gave error when tried to open received message which contains any type of image embedded/attached.Could you check and fix this ?

regards
Back to top
View user's profile Send private message
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 12877

PostPosted: Tue Nov 27, 2012 10:15 am    Post subject: Reply with quote

Please send a sample message to richviewgmailcom
Back to top
View user's profile Send private message Visit poster's website
bilgin



Joined: 26 Nov 2012
Posts: 2

PostPosted: Tue Nov 27, 2012 8:06 pm    Post subject: Reply with quote

Dear Sergey

Here are the results which i got from your demo

sender Hotmail - receiver Gmail
text mail - ok
text mail with file attachment(not image) - ok
mail with image on background - error
mail with attachment (image file) - error

sender Gmail -receiver Hotmail
text mail - ok
text mail with file attachment(not image) - ok
mail with image on background - ok
mail with attachment (image file) - no attachment file visible

regards
bilgin
Back to top
View user's profile Send private message
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 12877

PostPosted: Sun Dec 02, 2012 9:36 am    Post subject: Reply with quote

I tried Gmail email with attached images, and I can reproduce this problem.
It happens because this image appears not in TclMailMessage.Attachments, but in TclMailMessage.Images.

This demo was created with quite an old version of CleverComponents, I contacted them to get a new version, may be this problem is already fixed.
Back to top
View user's profile Send private message Visit poster's website
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 12877

PostPosted: Tue Dec 25, 2012 1:44 pm    Post subject: Reply with quote

Well, they said it's not a bug but a feature: attached images are not included in Attachments, but included in Images, together with images embedded in HTML.
As for me, this is a very inconvenient decision, because we need to find a way to distinguish attached and embedded images ourselves. Of course, it is solvable, I'll update the demo soon.
Back to top
View user's profile Send private message Visit poster's website
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 12877

PostPosted: Tue Dec 25, 2012 2:34 pm    Post subject: Reply with quote

I uploaded a fixed version.
Additionally, it was changed for compatibility with TRichView 14.

If you will have problems (exceptions) when opening an email dialog, open RVFontCombos.pas (from RichViewActions) and change 3 lines
Code:
  if RichViewEdit<>nil then begin
to
Code:
  if (RichViewEdit<>nil) and (RichViewEdit.Style<>nil) then begin
Back to top
View user's profile Send private message Visit poster's website
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 12877

PostPosted: Sun Jul 07, 2013 3:21 pm    Post subject: Reply with quote

Updated.
Changes:
1) RVAControlPanel1 is placed on the email composing form. It is directly assigned to all actions on the form. The previous code did not work properly if another instance of TRVAControlPanel was already created.
2) clHTTP1 is placed on the email composing form, and assigned to RVAControlPanel1.clHTTP. So now this editor can download images when pasting RTF with links.
This feature requires RichViewActions to be compiled with support of CleverComponents, see http://www.trichview.com/help-actions/clevercomponents.htm
Back to top
View user's profile Send private message Visit poster's website
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 12877

PostPosted: Tue Aug 09, 2016 1:22 pm    Post subject: Reply with quote

Updated: changed for compatibility with newer version of CleverComponents
Back to top
View user's profile Send private message Visit poster's website
xdbmw



Joined: 24 Sep 2011
Posts: 30

PostPosted: Wed Aug 10, 2016 4:32 pm    Post subject: Reply with quote

Are you sure that you have uploaded latest sources? Im not able to compile MailClient Project in 10.1Berlin.
Back to top
View user's profile Send private message
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 12877

PostPosted: Wed Aug 10, 2016 5:39 pm    Post subject: Reply with quote

Not, I am not sure. I'll contact the developers for the latest versions
Back to top
View user's profile Send private message Visit poster's website
xdbmw



Joined: 24 Sep 2011
Posts: 30

PostPosted: Thu Sep 15, 2016 12:18 pm    Post subject: Reply with quote

Sergey Tkachenko wrote:
Updated.
So now this editor can download images when pasting RTF with links.

Does it also include incoming HTML e-mails (containing image links) in MailClient example? As far as I can see it doesn't but maybe I misunderstood something.
Back to top
View user's profile Send private message
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 12877

PostPosted: Fri Sep 16, 2016 8:34 am    Post subject: Reply with quote

Yes, this demo not only sends, but also receives HTML emails.
It uses RvHtmlViewImporter to load HTML in TRichViewEdit.

Please note that HTML email may contain images of 3 types:
1) (the most common way) included in the same email, encoded together with HTML in MIME format. This type of images is supported by this demo.

2) HTTP links to images. This type of images is supported if you compile RichViewActions with support of CleverComponents, and assign TRVAControlPanel.ClHTTP property.
I am not sure if this settings was done in the compiled demo.

3) Images embedded directly in HTML, directly in <img src>. This type of images is supported by newer version of RvHtmlViewImporter, the compiled demo was made before implementing this future.
Back to top
View user's profile Send private message Visit poster's website
xdbmw



Joined: 24 Sep 2011
Posts: 30

PostPosted: Wed Oct 19, 2016 8:08 am    Post subject: Reply with quote

Sergey Tkachenko wrote:
3) Images embedded directly in HTML, directly in <img src>. This type of images is supported by newer version of RvHtmlViewImporter, the compiled demo was made before implementing this future.

Do you have an example for receiving this type of emails? Maybe you can update your demo source in
http://www.trichview.com/resources/clevercomponents/rvcleverdemos.zip
Thanks in advance.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    trichview.com Forum Index -> Announcements All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group