Improved doc on SetBody and AddAlternative

Fixes #48
This commit is contained in:
Alexandre Cesaro 2015-12-08 14:20:19 +01:00
parent df6fc79d10
commit 19acfc29a0
1 changed files with 5 additions and 4 deletions

View File

@ -177,7 +177,8 @@ func (m *Message) GetHeader(field string) []string {
return m.header[field] return m.header[field]
} }
// SetBody sets the body of the message. // SetBody sets the body of the message. It replaces any content previously set
// by SetBody, AddAlternative or AddAlternativeWriter.
func (m *Message) SetBody(contentType, body string) { func (m *Message) SetBody(contentType, body string) {
m.parts = []part{ m.parts = []part{
{ {
@ -193,9 +194,9 @@ func (m *Message) SetBody(contentType, body string) {
// AddAlternative adds an alternative part to the message. // AddAlternative adds an alternative part to the message.
// //
// It is commonly used to send HTML emails that default to the plain text // It is commonly used to send HTML emails that default to the plain text
// version for backward compatibility. // version for backward compatibility. AddAlternative appends the new part to
// // the end of the message. So the plain text part should be added before the
// More info: http://en.wikipedia.org/wiki/MIME#Alternative // HTML part. See http://en.wikipedia.org/wiki/MIME#Alternative
func (m *Message) AddAlternative(contentType, body string) { func (m *Message) AddAlternative(contentType, body string) {
m.parts = append(m.parts, part{ m.parts = append(m.parts, part{
header: m.getPartHeader(contentType), header: m.getPartHeader(contentType),