From 7b92dc3d9df3fdba495bcabe335402bc462ebcb0 Mon Sep 17 00:00:00 2001 From: Hongcai Deng Date: Mon, 7 Sep 2015 18:25:15 +0800 Subject: [PATCH 1/2] implemented #1528 --- modules/mailer/mailer.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go index ce3ffc270..6379b6b7f 100644 --- a/modules/mailer/mailer.go +++ b/modules/mailer/mailer.go @@ -48,6 +48,7 @@ type Message struct { To []string From string Subject string + Reply-To string Body string Type string Massive bool @@ -63,7 +64,7 @@ func (m Message) Content() string { } // create mail content - content := "From: " + m.From + "\r\nSubject: " + m.Subject + "\r\nContent-Type: " + contentType + "\r\n\r\n" + m.Body + content := "From: " + m.From + "\r\nReply-To: " + m.Reply-To + "\r\nSubject: " + m.Subject + "\r\nContent-Type: " + contentType + "\r\n\r\n" + m.Body return content } @@ -252,7 +253,8 @@ func SendAsync(msg *Message) { func NewHtmlMessage(To []string, From, Subject, Body string) Message { return Message{ To: To, - From: From, + From: setting.MailService.From, + Reply-To: From, Subject: Subject, Body: Body, Type: "html", From fbb3486c959f3835160cae62ca15c1b4fa197488 Mon Sep 17 00:00:00 2001 From: Hongcai Deng Date: Mon, 7 Sep 2015 18:28:56 +0800 Subject: [PATCH 2/2] fix syntax error --- modules/mailer/mailer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go index 6379b6b7f..ff82caa90 100644 --- a/modules/mailer/mailer.go +++ b/modules/mailer/mailer.go @@ -48,7 +48,7 @@ type Message struct { To []string From string Subject string - Reply-To string + ReplyTo string Body string Type string Massive bool @@ -64,7 +64,7 @@ func (m Message) Content() string { } // create mail content - content := "From: " + m.From + "\r\nReply-To: " + m.Reply-To + "\r\nSubject: " + m.Subject + "\r\nContent-Type: " + contentType + "\r\n\r\n" + m.Body + content := "From: " + m.From + "\r\nReply-To: " + m.ReplyTo + "\r\nSubject: " + m.Subject + "\r\nContent-Type: " + contentType + "\r\n\r\n" + m.Body return content } @@ -254,7 +254,7 @@ func NewHtmlMessage(To []string, From, Subject, Body string) Message { return Message{ To: To, From: setting.MailService.From, - Reply-To: From, + ReplyTo: From, Subject: Subject, Body: Body, Type: "html",