邮政 https://github.com/drewr/postal
我想用clojure发送邮件,但我不知道如何设置发件人名称。
这是我的代码。
(defn smtp []
{:host (env :mail-host)
:user (env :mail-user)
:pass (env :mail-pass)
:ssl :yes!!!11})
(defn mail [request]
{:from "demo@gmail.com"
:to "demo2@gmail.com"
:subject "subject"
:body "body"})
(defn send [request]
(p/send-message (smtp) (mail request)))
谢谢!
答案 0 :(得分:3)
您需要将地址从demo@gmail.com
更改为Your Name <demo@gmail.com>
(defn mail [request]
{:from "Tornado <demo@gmail.com>"
:to "Hurricane <demo2@gmail.com>"
:subject "subject"
:body "body"})