NetTalk Central

Author Topic: How to compose HTML email with WYSIWYG user interface in Nettalk  (Read 37062 times)

ianburgess

  • Full Member
  • ***
  • Posts: 119
    • View Profile
    • Email
I asked Bruce this question and he asked me to post it here so that everyone can benefit from his answer.....

I currently use Nettalk for sending and receiving emails, but at present only send plain text emails and now want to send HTML formatted emails with embedded images. Is there anything in Nettalk that allows WYSIWYG composing of the HTML by end users and are there any examples?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9320
    • View Profile
Re: How to compose HTML email with WYSIWYG user interface in Nettalk
« Reply #1 on: August 01, 2011, 12:18:27 AM »
Thanks Ian,

As you know the Email object has a .MessageText property, and this is used to contain the contents of a (text) email message.

It also has a property, .MessageHTML which you can prime with HTML. An email can be set with both the HTML and Text properties primed, allowing the user to read the email in HTML if they support HTML, and in text if they do not.

Images can be embedded in an email in 2 ways. Either as a "link" to a web site, or as data embedded in the email. Links to web sites keeps the email small, but because it can be used as a mechanism for tracking emails, many email clients block images by default. Embedded images make the mail bigger, but are also visible on the client side without any tracking worries (so are more likely to be seen.)

In Html images are included using the IMG tag. For example;
<img src="www.capesoft.com/images/capesoftlogo.png">
This is an example of a web-image - when the mail is opened the mail reader may, or may not, go and fetch that image.

You can also link to a file on your hard drive;
<img src="c:\images\capesoftlogo.png">

This is a sign you want to "embed" the image in the mail.
The embed mechanism is somewhat complicated, but fortunately NetTalk 5 has a method for making it simple. If you want to use embedded images construct the HTML as above, but then call the EmbedImages method. This method alters the HTML for you, AND returns the embedded list, so kills 2 birds with one stone.

for example;
EmailSender.embedList = EmailSender.EmbedImages(htmlSource, True, rootFolder) 

For more details go to
http://www.capesoft.com/docs/NetTalk5/NetTalk3.htm and search for EmbedImages.

With regard to WYSIWYG editing - no, NetTalk doesn't offer any WYSIWYG tools. File Explorer does that though, and there are several examples of the two working together. One tip though - Email readers usually support a fairly limited subset of HTML functionality. So try and keep your emails as simple as possible.

Cheers
Bruce



ianburgess

  • Full Member
  • ***
  • Posts: 119
    • View Profile
    • Email
Re: How to compose HTML email with WYSIWYG user interface in Nettalk
« Reply #2 on: August 01, 2011, 02:28:47 AM »
Thanks Bruce, I will certainly take a look at File Explorer.

Regards

Ian

Rene Simons

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: How to compose HTML email with WYSIWYG user interface in Nettalk
« Reply #3 on: August 03, 2011, 05:01:47 AM »
Hi Ian,

Maybe a sidestep but there is a book about HTML emails

Create Stunning HTML Email That Just Works! by Mathew Patterson

You can find it at http://www.sitepoint.com

Cheers,
Rene Simons