Setup
org-mime
exposes two functions
- `org-mime-htmlize'
- can be called from within a mail composition buffer to export either the entire buffer or just the active region to html, and embed the results into the buffer as a text/html mime section.
org-mime-htmlize is an interactive Lisp function in `org-mime.el'. (org-mime-htmlize ARG) Export a portion of an email body composed using `mml-mode' to html using `org-mode'. If called with an active region only export that region, otherwise export the entire body.- `org-mime-org-buffer-htmlize'
- can be called from within an Org-mode buffer to export either the whole buffer or the narrowed subtree or active region to HTML, and open a new email buffer including the resulting HTML content as an embedded mime section.
org-mime-org-buffer-htmlize is an interactive Lisp function in `org-mime.el'. (org-mime-org-buffer-htmlize) Export the current org-mode buffer to HTML using `org-export-as-html' and package the results into an email handling with appropriate MIME encoding.The following key bindings are suggested, which bind the
C-c M-o
key sequence to the appropriateorg-mime
function in both email and Org-mode buffers.(add-hook 'message-mode-hook (lambda () (local-set-key "\C-c\M-o" 'org-mime-htmlize))) (add-hook 'org-mode-hook (lambda () (local-set-key "\C-c\M-o" 'org-mime-org-buffer-htmlize)))