MCPcopy Index your code
hub / github.com/TruthHun/BookStack / SendMail

Function SendMail

utils/util.go:136–153  ·  view source on GitHub ↗

@param conf 邮箱配置 @param subject 邮件主题 @param email 收件人 @param body 邮件内容

(conf *conf.SmtpConf, subject, email string, body string)

Source from the content-addressed store, hash-verified

134// @param email 收件人
135// @param body 邮件内容
136func SendMail(conf *conf.SmtpConf, subject, email string, body string) error {
137 msg := &mail.Message{
138 Header: mail.Header{
139 "From": {conf.FormUserName},
140 "To": {email},
141 "Reply-To": {conf.ReplyUserName},
142 "Subject": {subject},
143 "Content-Type": {"text/html"},
144 },
145 Body: strings.NewReader(body),
146 }
147 port := conf.SmtpPort
148 host := conf.SmtpHost
149 username := conf.FormUserName
150 password := conf.SmtpPassword
151 m := mailer.NewMailer(host, username, password, port)
152 return m.Send(msg)
153}
154
155// 渲染markdown为html并录入数据库
156func RenderDocumentById(id int) {

Callers 1

FindPasswordMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected