email - 在 Emacs 程序中发送电子邮件

标签 email emacs elisp

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

我已将 emacs 配置为通过我的 gmail account 发送邮件我希望能够从 elisp 程序给自己发送电子邮件。使用的命令是message-mail。

最佳答案

这是消息邮件的包装器,提示您输入“收件人”和“主题”行:

(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)))

关于email - 在 Emacs 程序中发送电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/679275/

相关文章:

security - 是否值得对数据库中的电子邮件地址进行加密?

emacs - 如何在同一窗口中执行emacs grep-find链接?

emacs - 使用 evil-mode 正确编辑 shell 缓冲区

emacs - Elisp 重命名宏

Emacs 设置 which-function-mode

emacs - 获取正在运行的 Emacs 计时器列表

Emacs 函数创建新终端

c - 输入到其他程序/C++]

mysql - Laravel 发送电子邮件 call_user_func() 错误

linux - 在没有用户干预的情况下使用 apt-get 安装 mailutils