1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 18:30:56 +00:00

fix the mail send empty subject

This commit is contained in:
astaxie 2016-01-17 23:48:09 +08:00
parent 566aab4354
commit 9b2597be68

View File

@ -96,12 +96,16 @@ func (e *Email) Bytes() ([]byte, error) {
e.Headers.Set("Disposition-Notification-To", strings.Join(e.ReadReceipt, ",")) e.Headers.Set("Disposition-Notification-To", strings.Join(e.ReadReceipt, ","))
} }
e.Headers.Set("MIME-Version", "1.0") e.Headers.Set("MIME-Version", "1.0")
e.Headers.Set("Content-Type", fmt.Sprintf("multipart/mixed;\r\n boundary=%s\r\n", w.Boundary()))
// Write the envelope headers (including any custom headers) // Write the envelope headers (including any custom headers)
if err := headerToBytes(buff, e.Headers); err != nil { if err := headerToBytes(buff, e.Headers); err != nil {
return nil, fmt.Errorf("Failed to render message headers: %s", err) return nil, fmt.Errorf("Failed to render message headers: %s", err)
} }
e.Headers.Set("Content-Type", fmt.Sprintf("multipart/mixed;\r\n boundary=%s\r\n", w.Boundary()))
fmt.Fprintf(w, "%s:", "Content-Type")
fmt.Fprintf(w, " %s\r\n", fmt.Sprintf("multipart/mixed;\r\n boundary=%s\r\n", w.Boundary()))
// Start the multipart/mixed part // Start the multipart/mixed part
fmt.Fprintf(buff, "--%s\r\n", w.Boundary()) fmt.Fprintf(buff, "--%s\r\n", w.Boundary())
header := textproto.MIMEHeader{} header := textproto.MIMEHeader{}