send email with content-type html?

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf send email with content-type html?

  • Creator
    Topic
  • #47833
    Keith McLeod
    Participant

    I would like to send email from alerts wher ethe content-type is html.  I am on AIX 5.1 CLoverleaf 3.8.1P rev 4 and other assorted versions.  I would like to save documents created in Word as html format, be able to email them from an alert trigger and have the body of the message display appropraitely.  So far not working for me…. Anybody doing this?

Viewing 0 reply threads
  • Author
    Replies
    • #56824
      Tom Henderson
      Participant

      We do something similar to send an email with a legal disclaimer in bold text.  The key is that email only really works with plain text, so the message has to be properly encoded with MIME for it to work correctly.  The format for HTML email is to MIME-encode the message as multipart/alternative, then supply the message as an HTML version (your document) and a plain text version.  Conceptually, each version carries the same message, but nothing really enforces that.  Spammers will often send out email where all the message is in the HTML part and the plain text part contains little or nothing.

      The reason for this is so someone can read your email whether the email client supports HTML email or not.

      Anyway, assuming that you a) have tcllib installed, which includes the MIME and SMTP extensions, and  b) have the HTML and plain-text message in an HTML file and a plain-text file named nogo.html and nogo.txt, and  c) change the email address and email server names to real-world values, this code should work.

Viewing 0 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,117
Forums
28
Topics
9,293
Replies
34,435
Topic Tags
286
Empty Topic Tags
10