Browse Source

org-mime: WL is now fully supported -- thanks to Eric S. Fraga

Eric Schulte 10 years ago
parent
commit
3b5c85fb95
1 changed files with 14 additions and 6 deletions
  1. 14 6
      contrib/lisp/org-mime.el

+ 14 - 6
contrib/lisp/org-mime.el

@@ -105,9 +105,15 @@
     ('mml (format
            "<#part type=\"%s\" filename=\"%s\" id=\"<%s>\">\n<#/part>\n"
            ext path id))
-    ('semi (format
-            "--[[application/octet-stream; type=%s\nContent-ID: %s; filename=\"%s\"][base64]]"
-            ext id path))
+    ('semi (concat
+            (format
+             "-- xx [[%s\nContent-Disposition: inline;\nContent-ID: <%s>][base64]]\n"
+             ext id)
+            (base64-encode-string
+             (with-temp-buffer
+               (set-buffer-multibyte nil)
+               (binary-insert-encoded-file path)
+               (buffer-string)))))
     ('vm "?")))
 
 (defun org-mime-multipart (plain html)
@@ -117,9 +123,11 @@
     ('mml (format (concat "<#multipart type=alternative><#part type=text/plain>"
                           "%s<#part type=text/html>%s<#/multipart>\n")
                   plain html))
-    ('semi (format (concat "--<<alternative>>-{\n--[[text/plain;%s\n--]]\n"
-                           "--[[text/html;%s\n--]]\n--}-<<alternative>>\n")
-                   plain html))
+    ('semi (concat
+            "--" "<<alternative>>-{\n"
+            "--" "[[text/plain]]\n" plain
+            "--" "[[text/html]]\n"  html
+            "--" "}-<<alternative>>\n"))
     ('vm "?")))
 
 (defun org-mime-replace-images (str current-file)