From 19acfc29a0673cd2c66d4bc061d70e88909e3ff8 Mon Sep 17 00:00:00 2001 From: Alexandre Cesaro Date: Tue, 8 Dec 2015 14:20:19 +0100 Subject: [PATCH] Improved doc on SetBody and AddAlternative Fixes #48 --- message.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/message.go b/message.go index 2b6c0e8..7fbfc3f 100644 --- a/message.go +++ b/message.go @@ -177,7 +177,8 @@ func (m *Message) GetHeader(field string) []string { 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) { m.parts = []part{ { @@ -193,9 +194,9 @@ func (m *Message) SetBody(contentType, body string) { // AddAlternative adds an alternative part to the message. // // It is commonly used to send HTML emails that default to the plain text -// version for backward compatibility. -// -// More info: http://en.wikipedia.org/wiki/MIME#Alternative +// 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 +// HTML part. See http://en.wikipedia.org/wiki/MIME#Alternative func (m *Message) AddAlternative(contentType, body string) { m.parts = append(m.parts, part{ header: m.getPartHeader(contentType),