IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    [原]mu4e中使用org mode编辑邮件并发送为html邮件

    sheismylife发表于 2017-03-24 14:05:08
    love 0

    用org mode方式编辑邮件是一个很有诱惑的想法,同时还可以转换成html文档发出去。图片暂时不清楚怎么弄。

    在.spacemacs文件中添加下面这段:

      ;; convert org content in mu4e to html and send
      (require 'org-mime)
      
      (defun mu4e-compose-org-mail ()
        (interactive)
        (mu4e-compose-new)
        (org-mu4e-compose-org-mode))
    
      (defun htmlize-and-send ()
        "When in an org-mu4e-compose-org-mode message, htmlize and send it."
        (interactive)
        (when (member 'org~mu4e-mime-switch-headers-or-body post-command-hook)
          (org-mime-htmlize) 
          (message-send-and-exit)))
    
      (add-hook 'org-ctrl-c-ctrl-c-hook 'htmlize-and-send t)
    

    然后重新启动emacs后进入mu4e, 

    M-x mu4e-compose-org-mail 创建新邮件。如果按C创建新邮件,仍然是文本邮件。

    稍等一会儿,可以用org mode编辑文本了。

    发送仍然使用C-c C-c.


    参考:

    http://kitchingroup.cheme.cmu.edu/blog/2016/10/29/Sending-html-emails-from-org-mode-with-org-mime/





沪ICP备19023445号-2号
友情链接