From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [ANN] org-mime -- using orgmode to send html mail? Date: Fri, 09 Apr 2010 10:41:54 -0600 Message-ID: <8739z44lyl.fsf@gmail.com> References: <878w9krtyn.wl%dmaus@ictsoc.de> <871vfa24qo.fsf@gmail.com> <87pr2uww2d.fsf@columbia.edu> <87tys5zrwm.fsf@gmail.com> <87sk7pzk02.fsf@stats.ox.ac.uk> <87tys5r3q6.fsf@gmail.com> <87ocid7cuj.wl%dmaus@ictsoc.de> <874ok5qxp9.fsf@gmail.com> <87vdckksnj.wl%dmaus@ictsoc.de> <874ok33zje.fsf@gmail.com> <87zl1vf4ru.wl%dmaus@ictsoc.de> <874ok311t9.fsf@gmail.com> <87y6h85pid.fsf_-_@gmail.com> <87fx3g1cld.fsf@stats.ox.ac.uk> <87eij05had.fsf@gmail.com> <878w98w4sz.fsf@stats.ox.ac.uk> <87sk7f8d6x.fsf@gmail.com> <87aatizcef.fsf@gmail.com> <71591C25-1B0B-4162-A53C-16DB9436C0F3@gmail.com> <8739z9c3vq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O0HHT-0007uc-5m for emacs-orgmode@gnu.org; Fri, 09 Apr 2010 12:42:07 -0400 Received: from [140.186.70.92] (port=33991 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0HHP-0007sT-Ty for emacs-orgmode@gnu.org; Fri, 09 Apr 2010 12:42:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O0HHM-0003vU-0E for emacs-orgmode@gnu.org; Fri, 09 Apr 2010 12:42:03 -0400 Received: from mail-pv0-f169.google.com ([74.125.83.169]:49203) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0HHL-0003vA-DI for emacs-orgmode@gnu.org; Fri, 09 Apr 2010 12:41:59 -0400 Received: by pvg11 with SMTP id 11so2693151pvg.0 for ; Fri, 09 Apr 2010 09:41:58 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Announcing the addition of org-mime to the contrib directory of Org-mode this allows sending HTML email using org-mode including... --=-=-= Content-Type: multipart/alternative; boundary="==-=-=" --==-=-= #+TITLE: NONE #+OPTIONS: latex:t - *tables* | colname one | colname two | |-------------+-------------| | 1 | 1 | | 2 | 4 | | 3 | 9 | - *inline images* including latex equations $f(n) = n + \frac{1}{n} \int_{0}^{n}{d_x f(x) + f(n - x)}$ and the results of ditaa blocks, etc... #+begin_src ditaa :file blue.png :cmdline -r +---------+ | cBLU | | | | +----+ | |cPNK| | | | +----+----+ #+end_src - *blockquotes* #+begin_quote HTML e-mail is the use of a subset of HTML (often ill-defined) to provide formatting and semantic markup capabilities in e-mail that are not available with plain text. -- wikipedia #+end_quote - fontified *code blocks* (shown below) - and *HTML character* conversion, like \forall character c s.t. \exists h \in /HTML characters/ and c \equiv h, org-html-export of c results in h --==-=-= Content-Type: text/html
  • tables
    colname onecolname two
    11
    24
    39
  • inline images including latex equations $f(n) = n + \frac{1}{n}
  \int_{0}^{n}{d_x f(x) + f(n - x)}$ and the results of ditaa blocks, etc…

blue.png

  • blockquotes

    HTML e-mail is the use of a subset of HTML (often ill-defined) to provide formatting and semantic markup capabilities in e-mail that are not available with plain text. – wikipedia

  • fontified code blocks (shown below)
  • and HTML character conversion, like ∀ character c s.t. ∃ h ∈ HTML characters and c ≡ h, org-html-export of c results in h
--==-=-=-- --=-=-= Content-Type: image/png Content-ID: <_tmp_blue.png> Content-Disposition: attachment; filename=blue.png Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAJYAAACa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OTEyMjcX5J1rOisXExKSkpOzcuRMVy8vL kxZpaS9jtVqFeFFbSl9fH1bmR48eoXMZjUadTodxgAUJNZb5tjM89OTJk1euXKmqqqqrq5NuCEFj ockwr2JolpSU4Gfkv4MNSyDaBMtzRUUFelVTU5PNZhPiugQp/f393d3daKmGhgYoopZoLGlDgch5 2xkeimkKfjg4Y6aSbnjBruHx48f37t3DJgJTq1Qxme9gw0MvX76M4yD8sAqib2EWFeLSkjfp7e1F ez158gRjEY2FdQj7ZswY1+QNHoo+hDEHM5y6pHuW0L1wiEbHh+udO3fwMzLXCu2A3oM2wRmssbER fR0bGUxdA2jnD0iIDgXFrq4uNFxLSwsgMY89eJ37cgXPwkNB1draiokdctJMhcaSKob/RwtKFZOz VlLF8GipYqgM2moAQ/DDEkqKaDIs0Wg7jEjUFa32VN7goXg0KoBqvFlp/l4xmWuFdsBkjpGHWQF4 A76A7YMTMjKEhCRkSMiQkIQkJCFDQoaEJCQhCRkSMiQkIQlJyJCQISEJSUhChoQMCUlIQhIyJGRI SEISDhZCxkVDQhIyzs5fxRlSr4VX/icAAAAASUVORK5CYII= --=-=-= Content-Type: image/png Content-ID: <_tmp_ltxpng_mail78058-A_b023893fa20418a1525cad63accc444e9a8954d3.png> Content-Disposition: attachment; filename=mail78058-A_b023893fa20418a1525cad63accc444e9a8954d3.png Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAQsAAAAXCAYAAAAcNmoGAAAIPElEQVR4Ae2ciZHVOBBAmS0CmB0i WMiAI4KFDDgiADKAIoItyAAyYCED2AyADCADjgzY9zSWS18+xpI9/n+m3FVCV3er1Wq1WvIfjn7/ /n1lg/1o4Ojo6B0jP2YNfu1Hgm3UTQPTNXC0OYvpyloKEydxH153SM9Ify7tLOAv33uk56TbpGPS NcaxvsGmgSoN/FFFBREGedwYfRELaJ4UEVxCZDbt+2bjzo4o0OdLddrkN8nvorL3jdoeMc4b0ivq B6t3ZL60tlQ7t32bPXJ37KXaWTCZlxp9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4LtB2y9WlF27HR7U vU60X6am8B3DgZdyeq00EkrTTvRC36W1pTXnNrYWa/Qx184ej28Wvid4Wmlw8cSg2g/geMcN/+kK 5fYLRz92p1VDr/7dRYfbBWpo9GZElt67jTbO/PNx9O0bgdGM6+NbxKqRWTPu2GMmIgW4zLa05tyi PveVd/bp9t/qrbwUhukMeYvNF35gQ90IwAc6o4BBxwue7wSPScILcNuNS58OyEjDx7MAtPlm8Rdt 6XWl6d2yTQPlGghvFuVkG8UMDRgVGM5HMFIwukijjdjX5mx66XQKJ6mjEIG6tEZ7ho7xa0j8LwZs 2mDTwGwNbJHFbBUeBoMmuoi/s9Cx+IVl1AEdhuSbFBdFA/8DTCOnfO7awrIAAAAASUVORK5CYII= --=-=-= The original org-mode formatted plain text is included as a text/plain mime alternative to the generated html. Below find the org-mime export of the org-mime worg page which will be available at http://orgmode.org/worg/org-contrib/org-mime.php. Best -- Eric --=-=-= Content-Type: multipart/alternative; boundary="===-=-=" --===-=-= #+TITLE: org-mime.el --- org html export for text/html MIME emails #+OPTIONS: H:3 num:nil toc:3 \n:nil @:t ::t |:t ^:t -:t f:t *:t TeX:t LaTeX:t skip:nil d:(HIDE) tags:not-in-toc #+STARTUP: align fold nodlcheck hidestars oddeven lognotestate #+SEQ_TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@) #+TAGS: Write(w) Update(u) Fix(f) Check(c) #+AUTHOR: Eric Schulte #+EMAIL: schulte.eric at gmail dot com #+LANGUAGE: en #+PRIORITIES: A C B #+CATEGORY: worg * General =org-mime= can be used to send HTML email using Org-mode HTML export. This approximates a WYSiWYG HTML mail editor from within Emacs, and can be useful for sending tables, notified source code, and inline images in email. * How to use it ** 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 appropriate =org-mime= function in both email and Org-mode buffers. #+begin_src emacs-lisp (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))) #+end_src ** CSS style customization Email clients will often strip all global CSS from email messages. In the case of web-based email readers this is essential in order to protect the CSS of the containing web site. To ensure that your CSS styles are rendered correctly they must be included in the actual body of the elements to which they apply. The `org-mime-html-hook' allows for the insertion of these important CSS elements into the resulting HTML before mime encoding. The following are some possible uses of this hook. - for those who use color themes with Dark backgrounds it is useful to set a dark background for all exported code blocks and example regions. This can be accomplished with the following #+begin_src emacs-lisp (add-hook 'org-mime-html-hook (lambda () (org-mime-change-element-style "pre" (format "color: %s; background-color: %s; padding: 0.5em;" "#E6E1DC" "#232323")))) #+end_src - the following can be used to nicely offset block quotes in email bodies #+begin_src emacs-lisp (add-hook 'org-mime-html-hook (lambda () (org-mime-change-element-style "blockquote" "border-left: 2px solid gray; padding-left: 4px;"))) #+end_src For other customization options see the =org-mime= customization group. * Credits =org-mime= was developed by Eric Schulte with much-appreciated help and discussion from everyone on the "[[http://thread.gmane.org/gmane.emacs.orgmode/23153][using orgmode to send html mail]]" thread especially David Maus. --===-=-= Content-Type: text/html

General

org-mime can be used to send HTML email using Org-mode HTML export.

This approximates a WYSiWYG HTML mail editor from within Emacs, and can be useful for sending tables, notified source code, and inline images in email.

How to use it

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 appropriate org-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)))

CSS style customization

Email clients will often strip all global CSS from email messages. In the case of web-based email readers this is essential in order to protect the CSS of the containing web site. To ensure that your CSS styles are rendered correctly they must be included in the actual body of the elements to which they apply.

The `org-mime-html-hook' allows for the insertion of these important CSS elements into the resulting HTML before mime encoding. The following are some possible uses of this hook.

  • for those who use color themes with Dark backgrounds it is useful to set a dark background for all exported code blocks and example regions. This can be accomplished with the following
    (add-hook 'org-mime-html-hook
              (lambda ()
                (org-mime-change-element-style
                 "pre" (format "color: %s; background-color: %s; padding: 0.5em;"
                               "#E6E1DC" "#232323"))))
    
  • the following can be used to nicely offset block quotes in email bodies
    (add-hook 'org-mime-html-hook
              (lambda ()
                (org-mime-change-element-style
                 "blockquote" "border-left: 2px solid gray; padding-left: 4px;")))    
    

For other customization options see the org-mime customization group.

Credits

org-mime was developed by Eric Schulte with much-appreciated help and discussion from everyone on the "using orgmode to send html mail" thread especially David Maus.

--===-=-=-- --=-=-= "Eric Schulte" writes: > Carsten Dominik writes: > >> On Apr 5, 2010, at 7:39 AM, Eric Schulte wrote: >> >>> Hi, >>> >>> It is now possible to send HTML mail directly form an org-mode buffer. >>> >>> Calling `org-mime-org-buffer-htmlize' (could probably use a better >>> name) >>> from inside of an org-mode buffer will use `org-export-as-html' to >>> generate HTML of the buffer (respecting regions and subtree >>> narrowing), >>> and will then package the resulting HTML with all linked images into a >>> message buffer. >>> >>> As usual thanks to Carsten's thoughtfully organized functions and >>> control variables this was surprisingly easy to implement. >>> >>> Cheers -- Eric >>> >>> The code is still up at http://github.com/eschulte/org-mime >> >> CONTIRB? yes, after the release..... >> > > Sounds great, I'm move this into contrib then. -- Eric > >> >> - Carsten >> >>> >>> "Eric Schulte" writes: >>> >>>> Dan Davison writes: >>>> >>>> [...] >>>> >>>>> >>>>> As I understand it the code you've written is designed to be >>>>> called in a >>>>> message-mode buffer with orgstruct-mode in force. Would it make >>>>> sense to >>>>> also include in your package a complementary function, that one >>>>> calls in >>>>> an org-mode buffer? I envisage this generating the HTML, forming the >>>>> multipart email contents, and then saving it to the kill ring, so >>>>> that >>>>> it can be pasted into an email. >>>>> >>>>> This function would have access to the directory-name and so >>>>> should be >>>>> able to resolve relative paths. Also, there might be some other >>>>> advantages -- for example when exporting just a region or subtree, >>>>> buffer-wide properties such as #+TITLE and #+AUTHOR are picked up >>>>> by the >>>>> org exporter and packaged into the HTML. >>>>> >>>>> In other words, can I use your machinery to package up the HTML >>>>> generated by Org's C-e dispatcher into an appropriately-constructed >>>>> email? >>>>> >>>> >>>> Hi Dan, >>>> >>>> That sounds like a good idea, I've added it to a fledgling task list >>>> packaged in the README at [1]. I'd say there are two options. >>>> >>>> 1) which you mentioned saving the entire exported content to the >>>> kill-ring. One problem here is that everything is still text and >>>> pastable only *before* the mime export process, which means that >>>> linked images wouldn't resolve after pasting into the email client. >>>> >>>> 2) having the function generate a new mail buffer containing the >>>> exported content. This buffer would need to have it's >>>> `buffer-file-name' set, for images to resolve during export. I'm >>>> not >>>> sure how this should best work. >>>> >>>> Thanks -- Eric >>>> >>>> Footnotes: >>>> [1] http://github.com/eschulte/org-mime >>> >>> >>> _______________________________________________ >>> Emacs-orgmode mailing list >>> Please use `Reply All' to send replies to the list. >>> Emacs-orgmode@gnu.org >>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >> >> - Carsten --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--