Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ package mail

// VERSION indicates the current version of the package. It is also attached to the default user
// agent string.
const VERSION = "0.7.1"
const VERSION = "0.7.2"
12 changes: 8 additions & 4 deletions msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -1496,9 +1496,9 @@ func (m *Msg) GetSender(useFullAddr bool) (string, error) {
}
}

addr := from[0]
addr := *from[0]
if !useFullAddr {
addr.Name = ""
return mailAddressStringWithoutName(addr), nil
}
return addr.String(), nil
}
Expand All @@ -1524,8 +1524,7 @@ func (m *Msg) GetRecipients() ([]string, error) {
continue
}
for _, r := range addresses {
r.Name = ""
rcpts = append(rcpts, r.String())
rcpts = append(rcpts, mailAddressStringWithoutName(*r))
}
}
if len(rcpts) <= 0 {
Expand Down Expand Up @@ -3327,3 +3326,8 @@ func writeFuncFromBuffer(buffer *bytes.Buffer) func(io.Writer) (int64, error) {
}
return writeFunc
}

func mailAddressStringWithoutName(addr mail.Address) string {
addr.Name = ""
return addr.String()
}
Loading