views:

975

answers:

5

Hi. I need to send Email from my Delphi application. What I need is a WYSIWYG editor that I can use in the application to create the body of the email in HTML. Any ideas? Thanks, Pieter.

+1  A: 

The ProfDHTMLEdit Component looks like what you are looking for

Juraj Blahunka
It's using the Microsoft IE components for this. If that isn't a problem, you can use this.
Edelcom
+4  A: 

I have been looking for this as well for several years now.

  • The best solution I found, until now, is WpTools from WpCubed. It's not an exact Html editor, but an advanced word processing component which offers a copy mode to and from html. I am currently working on using this component in my Sitestepper web creation software (in the StepEdit html-editor to offer wysiwyg possibility). I think that certainly for email editing this could be used (although maybe a bit pricy for what you are looking for). I know the author is working an a better exchange to and from html.

    But to be honest, I don't think you will find anything if you need a Delphi component.

  • I used to use HtmlEdit from Purposesoft, but I think this product has got his limitations and it's not fully supported anymore. But maybe for your purpose it's ok.

Edelcom
+1 WpTools works very well for this, as you can import from and export to HTML, which is all that is needed.
skamradt
I agree, but you if you want to have your own code (as there are comments and javascripts) intact, it doesn't preserve them (I hope the update the author is writing, fixes this problem. But for an email program, this would work very well (if you want to pay the price for it).
Edelcom
A: 

If using IE COM based components is not a problem then you can use this free product

http://bsalsa.com/product.html

I have just recently needed a free HTML WYSIWYG editor and I thinks this is the only thing out there. For me it works fine, but I don't need complicated elements. They can be done, but will a little more work.

Runner
+2  A: 

We've used TRichView just recently to do HTML email functionality and found it quite adequate. We did evaluate WpTools and it does do exactly what we wanted however for our needs it was just too expensive especially when we always try and purchase site licences.

One thing we did find with WpTools is that it did implement a visual component or set of visual components that you could drop onto a form that implement the whole WYSIWYG UI (e.g. toolbars and such). It took a bit longer with TRichView to achieve the same thing.

Regarding conversion from/to html - TRichView can export html natively, however requires third-party libraries to import html which unfortunately (for us) are not commercially backed (i.e. community driven). So we've resorted to storing all content in RichText natively and only when sending the email do we convert it to html. WpTools has the ability to import/export to html natively.

If you use TMS they have TRTFEngine class which supports importing HTML.
Runner
@Runner - Thanks - wasn't aware of that. Turns out for our particular use-case saving the content in RichText worked out for the best as the inline images are stored within the RichText content.
Did you test what Outlook 2007 makes of your html e-mail? Outlook 2007 uses Word as it's html-viewer, which is of the WhatYouThinkYouGetIsNotReallyWhatYouGet sort.
The_Fox
@The_Fox - We did briefly test in Outlook 2007 without issue, however the emails that are typically sent from our application are not feature rich html emails. In our application we do provide the ability to paste in html source if the user needs pixel perfect reproduction of their email.
This solution gave me the answer I needed. The only difference is that we use JvRichEdit instead of TRichView. Thank you for the advice. Regards, Pieter.
Pieter van Wyk
+3  A: 

I've used EmbeddedWB from bsalsa. Basically it is the same as Delphi's TWebBrowser, but you have access to more features of the IE automation object. In the browser I loaded an HTML which looks like:

<html>
<head>
<title>Edit description</title>    
</head>

<body contenteditable="true">
</body>
</html>

Marking an element by IE specific attribute "contenteditable", the IE implementation let's you edit the element's inner HTML in a WYSIWYG manner. You can get the content by automation calls (check bsalsa.com to see how to read the edited content). If you get the basics it is pretty simple to create a full blown HTML editor.

Good luck!

r4w8173