branch: elpa/org-mime
commit 80b4e3a3b4826aa1bb60484119f6997fd0d5555b
Author: Chen Bin <[email protected]>
Commit: Chen Bin <[email protected]>
add readme
---
README.org | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)
diff --git a/README.org b/README.org
new file mode 100644
index 0000000000..b2f8e657a6
--- /dev/null
+++ b/README.org
@@ -0,0 +1,63 @@
+* 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, fontified source code, and inline images in email.
+* Setup
+#+begin_src elisp
+(require 'org-mime)
+;; for gnus – this is set by default
+(setq org-mime-library 'mml)
+;; OR for Wanderlust (WL)
+;; (setq org-mime-library 'semi)
+;; OR for VM – not yet supported
+;; (setq org-mime-library 'vm)
+#+end_src
+* Usage
+** =M-x org-mime-htmlize=
+=M-x org-mime-htmlize= 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.
+
+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.
+
+Warning: There has been some concern voiced over the potential complexity of
email resulting from calling this function on an active region resulting in
multiple =multipart/alternative= sections in the same email. Please see this
email thread for a discussion of the potential pitfalls of this approach.
Speaking from personal experience this has not been a problem for the author.
+
+** =M-x org-mime-org-buffer-htmlize=
+=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.
+
+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 elisp
+(add-hook 'message-mode-hook
+ (lambda ()
+ (local-set-key (kbd "C-c M-o") 'org-mime-htmlize)))
+(add-hook 'org-mode-hook
+ (lambda ()
+ (local-set-key (kbd "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 elisp
+(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;")))
+#+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
[[https://lists.gnu.org/archive/html/emacs-orgmode/2010-03/msg00500.html][using
orgmode to send html mail]] thread especially Eric S. Fraga for adding WL
support.
+* Licence
+Documentation from the http://orgmode.org/worg/ website (either in its HTML
format or in its Org format) is licensed under the
[[http://www.gnu.org/copyleft/fdl.html][GNU Free Documentation License version
1.3]] or later. The code examples and css stylesheets are licensed under the
[[http://www.gnu.org/licenses/gpl.html][GNU General Public License v3 or
later]].