complete-computing-environment/org-mime.org

2.7 KiB

Sending Rich Text with Org Mime

I wrote in my Gnus configuration that I prefer plaintext email to HTML, but I aim to send HTML email by default in most situations1. Ironic that I'm willing and able to inflict HTML mail on the rest of the world, huh? Nah. I encourage people to make decisions based on choices they care about and I don't think most people care about this, and those who do have powerful enough tools to make that decision.

I don't believe that HTML mail should automatically opt you in to a surveillance panopticon, and I don't think it's reasonable to make insecure choices by default, vis a vis embedded images, and indeed reasonable systems should not display images by default. There are principled mail providers like ProtonMail and Hey.com which will alert and block HTML mail tracking technology. Hypermedia and Hypertext are some of the better inventions and I think when used in good faith it can be a powerful tool.

And so I use it in good faith: With org-mime I use org-mode to draft my mail, attaching a "plain-text" org-mode markup along with an HTML export of that mail for folks with different dogmas than me. This allows me to reasonably attach well-formatted source code, links to documentation and research, and limited semantic markup to my documents. I promise I won't use Comic Sans:

(provide 'cce/org-mime)
(use-package org-mime
  :after gnus
  :config
  (setq org-mime-library 'mml
        org-mime-export-options '(:section-numbers nil
                                  :with-author nil
                                  :with-toc nil))
  :bind
  (:map message-mode-map ("C-c M-o" . org-mime-htmlize))
  (:map org-mode-map ("C-c M-o" . org-mime-org-buffer-htmlize)))

With this loaded, I can add keywords to pages in my Zettelkasten such that running org-mime-org-buffer-htmlize on a Zettel page will cause it to be mailed:

#+MAIL_TO: some1@some.place
#+MAIL_SUBJECT: a subject line
#+MAIL_CC: some2@some.place
#+MAIL_BCC: some3@some.place
#+MAIL_FROM: sender@some.place

1

I prefer to maintain plain-text conversation for one-on-one communication.