代码之家  ›  专栏  ›  技术社区  ›  justinhj

在Emacs程序中发送电子邮件

  •  4
  • justinhj  · 技术社区  · 17 年前

    有没有办法从区域或缓冲区生成电子邮件,设置收件人,然后以elisp代码发送邮件?

    gmail account 我希望能够通过elisp程序向自己发送电子邮件。使用的命令是消息邮件。

    1 回复  |  直到 14 年前
        1
  •  5
  •   Trey Jackson    17 年前

    下面是一个邮件包装器,提示您输入“收件人”和“主题”行:

    (defun my-message-mail-region (b e to subject)
      "Send the current region in an email"
      (interactive "r\nsRecipient: \nsSubject: ")
      (let ((orig-buffer (current-buffer)))
        (message-mail to subject)
        (message-goto-body)
        (insert (save-excursion (set-buffer orig-buffer)
                                (buffer-substring-no-properties b e)))
        (message-send-and-exit)))