| View previous topic :: View next topic |
| Author |
Message |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 9846
|
Posted: Tue Sep 28, 2010 3:20 pm Post subject: |
|
|
Process OnWriteHyperlink event.
In this event, write:
Target := PChar(RVData.GetItemTag(ItemNo));
Make sure that rvoTagsArePChars is included in Options.
Update 2011-Oct-22:
For TRichView 13.3+, the code should be
Target := RVData.GetItemTag(ItemNo);
And rvoTagsArePChars is obsolete and does nothing. |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 9846
|
Posted: Wed May 09, 2012 10:12 am Post subject: |
|
|
A new demo using Indy is added (in Delphi\Indy folder).
The old demo was moved to Delphi\Indy.old.
Old demo:
This demo tricks Indy. Indy thinks that this is a plain text message, but the demo includes all HTML email codes in the plain text, so it is actually an HTML email.
This demo can be used with all versions of Indy (may be with some minor modifications) and Delphi. It requires thirdparty code (included) for base64 encoding.
New demo:
This demo uses Indy features to create an HTML email. It requires Indy 10+ (because Indy 9 did not allow nested mime sections, required for HTML emails).
This demo requires Delphi 2009 or newer (it was created in Delphi XE2)
Note: the new version of Indy allows creating HTML email even more easily, using TIdMessageBuilderHtml. I was not aware about this class when creating this demo. Nevertheless, the results of this demo and of TIdMessageBuilderHtml must be identical. |
|
| Back to top |
|
 |
PioPio
Joined: 18 Feb 2013 Posts: 8
|
Posted: Sat Mar 02, 2013 11:28 pm Post subject: |
|
|
| Sergey Tkachenko wrote: | A new demo using Indy is added (in Delphi\Indy folder).
New demo:
This demo uses Indy features to create an HTML email. It requires Indy 10+ (because Indy 9 did not allow nested mime sections, required for HTML emails).
This demo requires Delphi 2009 or newer (it was created in Delphi XE2)
Note: the new version of Indy allows creating HTML email even more easily, using TIdMessageBuilderHtml. I was not aware about this class when creating this demo. Nevertheless, the results of this demo and of TIdMessageBuilderHtml must be identical. |
I ran this example but it seems the email sent doesn't take into account the Font name and the attributes, Bold, Italic, Underline (I haven't checked the alignment options).
Is there a way to fix this ?
Many thanks
Pio Pio |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 9846
|
Posted: Sun Mar 03, 2013 6:29 am Post subject: |
|
|
All font attributes must be taken into account.
Please send me step-by-step instructions how to reproduce the problem. |
|
| Back to top |
|
 |
PioPio
Joined: 18 Feb 2013 Posts: 8
|
Posted: Sun Mar 03, 2013 10:25 am Post subject: |
|
|
| Sergey Tkachenko wrote: | All font attributes must be taken into account.
Please send me step-by-step instructions how to reproduce the problem. |
Hello Sergey,
I opened the example SendMail in the folder Indy and ran it. The email was sent successfully but the text is in Comic Sans MS in TRichViewEdit1 and in the email is a different one.
I made then another test, amended TVStyle.TextStyles[1].size=20 and ran the example again. The email was sent successfully again but the size didn't change in the email.
Many thanks
Pio Pio |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 9846
|
Posted: Sun Mar 03, 2013 12:28 pm Post subject: |
|
|
| Please run this demo and send a test email to richviewgmailcom |
|
| Back to top |
|
 |
PioPio
Joined: 18 Feb 2013 Posts: 8
|
Posted: Sun Mar 03, 2013 12:34 pm Post subject: |
|
|
| Sergey Tkachenko wrote: | | Please run this demo and send a test email to richviewgmailcom |
Message was sent.
Thanks and regards,
Pio Pio |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 9846
|
Posted: Thu Mar 21, 2013 4:46 pm Post subject: |
|
|
I think I should post an answer here too.
TRichView.SaveHTMLToStreamEx uses named CSS classes to produce a clean and compact HTML code. Such HTML is shown correctly in desktop email clients. However, many online email clients (including the most popular ones) have problems with such HTML code - text and paragraph attributes are lost.
Solution:
1) Use SaveHTMLToStream instead of SaveHtmlToStreamEx. It produces basic HTML code without CSS.
Cons: only basic text and paragraph attributes are supported.
or
2) Include rvsoInlineCSS in the Options parameter of SaveHtmlToStreamEx. This will produce much larger HTML code, however, the problem will be solved. |
|
| Back to top |
|
 |
|