NetTalk Central

Author Topic: Sending Html Email  (Read 4264 times)

Jim A

  • Full Member
  • ***
  • Posts: 203
    • View Profile
    • Email
Sending Html Email
« on: November 02, 2012, 02:08:17 PM »
Hi All:  It's been a long day -- so if this is too obvious, my apologies.

I have a mem-form that allows a user to draft an html email.  This is then sent (along with parameters) to the EmailSend procedure, as per Example 11 (SendEmailFromBrowser).  The TinyMCE is ticked on and works properly.  I am sending the contents of the form's text field to both the EmailMessageHtml and EmailMessageTxt.  No matter what I've tried, the formatting gets dropped and all comes through as plain text (with the html markup notations).   

In my desktop apps I send in both html/text formats.  Is that not possible here?  Why doesn't the email go out properly formatted?  Am I missing a setting in the header?

Thanks,
Jim

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11307
    • View Profile
Re: Sending Html Email
« Reply #1 on: November 02, 2012, 09:40:34 PM »
Hi Jim,

The first thing to determine is if the html version gets dropped, or if the email client is just showing you the text version.

I assume you remove all the tags before creating the text version?

So a test I'd run is send a mail to a mailbox, and then use NetDemo GetEmial procedure to read it. In that way you can inspect the "Raw" contents of the HTML part, and the text part and see what's what.

Remember it's very common for email readers to default to the text part rather than the html part - so even if both parts are there you may see the text one.

Also, the engine used by email readers to display the html is very "primitive" there's no CSS or JS there. So checking out the "raw" html part may give you some clues as to why it doesn't get applied.

cheers
Bruce

Jim A

  • Full Member
  • ***
  • Posts: 203
    • View Profile
    • Email
Re: Sending Html Email
« Reply #2 on: November 03, 2012, 02:12:56 AM »
Thank you Bruce.  Makes sense.  I will give it a try.