github wneessen/go-mail v0.3.5
v0.3.5: Bugfix in msgWriter error handling and GetAddrHeader

latest releases: v0.7.2, v0.7.1, v0.7.0...
3 years ago

This release fixes a bug in the msgWriter error handling as well as introduces the new GetAddrHeader method. Thanks to @oschwald for both, the error report and the feature request.

  • The error handling in the msgWriter.writeBody method was not working properly. We basically overwrote the mw.err with nil if the function that followed after a failed write attempt was successful again.
  • SetHeader and SetHeaderPreformatted have been deprecated in favour of SetGenHeader and SetGenHeaderPreformatted As pointed out in #80 the naming was pretty confusing, given that we already have SetAddrHeader.
    With the new naming convention it should be more clear to the user, which method to use for which action. For compatibility reasons the old methods have been kept for now but in reality they are just aliases to the new methods.
  • GetAddrHeader and GetAddrHeaderString have been introduced As requested in #80 analogous to GetGenHeader we also need a similar method for the address headers. Since address headers are *mail.Address pointer, we've also added a *String method that will extract the address string and return a string slice instead.
  • Additionally we're introducing methods for the actual address headers: GetTo, GetFrom, GetCc and GetBcc (with a *String counterpart as well). This way the user has full flexibility. Either they use the more "low-level" GetAddrHeader method or the higher level methods for the corresponding address type

NOTE; We encourage users who use the SetHeader method in their code to switch to SetGenHeader instead.

What's Changed

Full Changelog: v0.3.4...v0.3.5

Don't miss a new go-mail release

NewReleases is sending notifications on new releases.