Forum OpenACS Q&A: HTML mails - best practise

Collapse
Posted by Michael Hinds on

What is best practise for sending an HTML e-mail? I want to send notifications for various events in a system. I don't need to keep the content once it's sent, although I don't mind using the CR if I have to. The mail should be a multipart with text/plain and text/html parts.

I've looked through the documentation and the mailing-lists package but I can't find a solution that feels nice.

The doc for acs-mail has a suitable example, but I read that acs-mail will be/is deprecated in favour of acs-mail-lite.

acs-mail-lite doesn't seem to have code for multipart mails (I like the rollout stuff though).

There is a hacky looking proc in acs-tcl/tcl/html-email-procs.tcl that, with the help of a crowbar, I could use (build_mime_message). Doesn't seem like the best option though.

The most up-to-date example I could find is in the developer guide, chapter 10. This calls the hacky looking proc in html-email-procs.tcl! hehehe.

This question has been asked before, but an update/clarification from our resident gurus would be appreciated. Thanks...

Collapse
Posted by Malte Sussdorff on
use acs-mail-lite from HEAD along with TCLLIB installed. This will give you all you need in the acs-mail-lite::complex_send procedure, as it is using tcllib's mime:: namespace to compose the message.

as for multipart e-mails, I'm might have forgotten to put this into acs-mail-lite::complex_send, so if you need this, just "rip it out" of mailing-list and stuff it into the procedure, so HTML mail can be send as multipart.