0%

在Emacs中使用Org简单发送邮箱

配置方式

outlook邮箱为例

Server name: smtp.office365.com
Port: 587
Encryption method: STARTTLS

  1. 我使用的是Spacemacs,则在配置文件~/.spacemacs中加入配置:
1
2
3
4
5
6
7
8
(setq
user-mail-address "email@hotmail.com"
message-send-mail-function 'smtpmail-send-it
smtpmail-smtp-service 587
smtpmail-smtp-server "smtp.office365.com"
smtpmail-stream-type 'starttls
smtpmail-auth-credentials '(expand-file-name "~/.authinfo.gpg")
)
  1. home目录下创建.authinfo文件,写入以下内容:
1
2
machine smtp.office365.com login "email@hotmail.com" port 587 password "password"
machine outlook.office365.com login "email" port 993 password "password"
  1. GPG encryption
1
$ gpg -c ~/.authinfo
  1. Send email

Org日程管理界面中,通过快捷方式Leader m打开发送窗口,在To:后面输入对方邮箱地址并完善余下内容信息即可

其他

  1. Manjaropacman安装wanderlust

    1
    $ sudo pacman -S --noconfirm --needed wanderlust
  2. Leader f e d配置Emacs

未完全配置:SMTP配置出错,跟上面配置冲突。只能IMAP收邮件到Mailbox

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
;; IMAP
(setq elmo-imap4-default-server "outlook.office365.com")
(setq elmo-imap4-default-user "ichheit@outlook.com")
(setq elmo-imap4-default-authenticate-type 'clear)
(setq elmo-imap4-default-port '993)
(setq elmo-imap4-default-stream-type 'ssl)

(setq elmo-imap4-use-modified-utf7 t)
(setq elmo-imap4-debug t)

;; SMTP
(setq wl-smtp-connection-type 'starttls)
(setq wl-smtp-posting-port 587)
(setq wl-smtp-authenticate-type "login")
(setq wl-smtp-posting-user "ichheit")
(setq wl-smtp-posting-server "smtp.office365.com")
(setq wl-local-domain "outlook.com")

(setq wl-default-folder "%inbox")
(setq wl-default-spec "%")
(setq wl-draft-folder "%[Outlook]/Drafts")
(setq wl-trash-folder "%[Outlook]/Trash")

(setq wl-folder-check-async t)

(setq elmo-imap4-use-modified-utf7 t)

(autoload 'wl-user-agent-compose "wl-draft" nil t)
(if (boundp 'mail-user-agent)
(setq mail-user-agent 'wl-user-agent))
(if (fboundp 'define-mail-user-agent)
(define-mail-user-agent
'wl-user-agent
'wl-user-agent-compose
'wl-draft-send
'wl-draft-kill
'mail-send-hook))

(progn
(require 'gnutls)
(open-gnutls-stream "gnutls-tests" nil "outlook.office365.com" 993))