NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Go modules, #1317 by repository stars
Latest stable
v0.8.2
Last release 14 days ago
08 Nov 2026
Release timing varies
gaps range from 8 days to 5 months
Nearly every release is documented
notes for 48 of 48 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
237 releases · first in 2022
Drag across the ruler to compare, or tap a release to open it.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
…in RFC8314, section 3.3. With #170 we've deprecated the WithSSL() and WithTLSPolicy options in favour of WithSSLPort(bool) and WithTLSPortPolicy(TLSPo…
This release of go-mail brings some new features as well as some code clean up and stability improvments.
The debug logging system in go-mail has been refactored. A new custom log type Log was introduced, that includes the message direction, format and arguments. The Logger interface and the Stdlog implementation were modified to accept this new type. This change is breaking custom implementations of the Logger interface, but the new interface provides much more flexibility (#136/#141). Additionally we added support for JSON logging (#142) using the log/slog package that has been added to the stdlib in Go 1.21.
This change is breaking custom logger implementations
#147 adds support for removing all attachments/embeds/parts from a Msg. This allows to re-use a Msg and allows for replacing message parts.
The following methods can be used:
Msg.UnsetAllAttachments()Msg.UnsetAllEmbeds()Msg.UnsetAllParts()Thanks to @leahoop for their first PR!
#155/#152 add support for three new methods that allow to read multiple recipient addresses for the TO:, CC: and BCC: fields from a single comma-separated string.
The following methods have been added:
Msg.ToFromString(string)Msg.CcFromString(string)Msg.BccFromString(string)Thanks to @suntong for requesting this useful feature!
With #167 we added support for delivery status indication of messages. This is especially helpful for bulk mailings to identify if a message was actually delivered or not. A helper method IsDelivered has been added that will return true after successful delivery of a Msg. Thanks to @mitar for requesting this useful feature!
When using SSL or STARTTLS, so far the default port was always 25, which is against best practices as described in RFC8314, section 3.3. With #170 we've deprecated the WithSSL() and WithTLSPolicy options in favour of WithSSLPort(bool) and WithTLSPortPolicy(TLSPolicy).
WithSSLPort tells the Client to use a SSL/TLS connection and automatically sets the port to 465.WithTLSPortPolicy tells the client to use the provided TLSPolicy and sets the correct port automatically. Port 587 is used for TLSMandatory and TLSOpportunistic. NoTLS will allways use port 25. If the connection fails with TLSOpportunistic, a plaintext connection is attempted on port 25 as a fallback.Thanks to @muhlemmer for raising the request and providing the first part of the PR.
We've added support for the auth login extension draft. This effectively is a draft that expired and was deprecated in favor of the AUTH PLAIN SASL extension (#163).
Thanks to @james-d-elliott for the PR!
The codebase has been reviewed and a couple of potential nil pointer dereferences have been identified and fixed.
Additionally, a potential panic has been fixed in fileFromReader (#161) - thanks to @rami-dabain for their first PR!
fileFromReader by @rami-dabain in https://github.com/wneessen/go-mail/pull/161Full Changelog: https://github.com/wneessen/go-mail/compare/v0.4.0...v0.4.1
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
This release adds two great improvements to go-mail.
This release adds two great improvements to go-mail.
The newly added option allows for providing custom dial contexts, to use i. e. for some more extra processes in establish a connection such as using proxy, DNS hook, and so on. The dial context can be provided via the WithDialContextFunc option on the Client. Huge thanks to @sters for their contribution to the project!
@drakkan (Developer of the excellent SFTPGO) added a new SMTP auth option for OAUTH2 authentication tokens (aka XOAUTH2). We now support Google and Microsoft O365 OAUTH2 authentication tokens. With this, go-mail now support 4 different SMTP Auth variants: LOGIN, PLAIN, CRAM-MD, XOAUTH2. Thanks again @drakkan for this contribution and also big thanks to @james-d-elliott for helping to test this new option and providing their broad knowledge to this feature.
We've synced up the changes that were made to the official go net/smtp package with our own copy. So this way go-mail is fully in sync with the official go package again.
Full Changelog: https://github.com/wneessen/go-mail/compare/v0.3.9...v0.4.0
Nothing published for this version
Nothing published for this version
Nothing published for this version
This release is the biggest since the initial release of the library. While there wasn't really much change on the surface, there happend a lot under
This release is the biggest since the initial release of the library. While there wasn't really much change on the surface, there happend a lot under the hood.
go-mail heavily relies on the Go stdlib net/smtp package. Unfortunately this lib is in feature freeze mode, so that enhancing/extending the package is not possible. This restricted us - at least to a certain degree - as we can't add features that would be useful for go-mail. For that reason we ported/forked the whole package over and adjusted all parts of go-mail to use it instead.
The original license has been imported and the license headers have been adjusted to reflect the go-mail's MIT license and the original Go BSD-3-Clause license. Additionally, the license headers have been converted to SPDX style.
Since we now have full control over the SMTP client part of go-mail, this allowed us to implement ldebug logging for the SMTP communication. Via the Client.WithDebugLog client option the user can enable this feature. It will then make use of the new smtp/Client.SetDebugLog method. Once the flag is set to true, the SMTP client will start logging incoming and outgoing messages to os.Stderr.
We've also implemented a simple log.Logger interface, as well as a standard logger that satisfies this interface. This allows the user to provide a custom logger, as long as the interface is stasified. If no custom logger is provided, the Stdlog will be used (which makes use of the Go stdlib again). Accordingly, a Client.WithLogger option and Client.SetLogger method have been implemented. Same applies for the smtp counterparts.
Details can be found in #102 and #115 .
With #108, #109 and #117 we provide more access to message parts (like attachments or embeds) for middlewares. Parts can now be gotten, set and deleted by middlewares.
Msg.AttachReader() would not output the attached file after consecutive writes (e.g. a write to a file and then send via Client). In #111 we fixed this behaviour by first reading the io.Reader into memory and then creating a new bytes.Reader, which does support seeking. In the writeFunc we then seek to position 0 after a successful io.Copy. This is probably not the most memory efficient way of handling this, but otherwise we'll have to break the io.Reader interface, which we do not want..
To compensate this, additionally, a new way of attaching/embedding files has been added: Msg.AttachReadSeeker() and Msg.EmbedReadSeeker() which take a io.ReadSeekeras argument instead. These two methods will skip the reading into memory and make use of the Seek method of the corresponding interface instead.
We recommend to make use of the new methods instead, to make the memory footprint low.
Special thanks go to @Karitham, @cvette and @halilylm for reporting bugs and/or providing PRs to address issues. Also big thanks to @james-d-elliott of the Authelia project for providing helpful insights on various issues with the library.
Full Changelog: https://github.com/wneessen/go-mail/compare/v0.3.8...v0.3.9
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
This release fixes a bug in the SMTP LOGIN Auth part of go-mail as reported in #94. The changes introduced in https://github.com/wneessen/go-mail/comm
This release fixes a bug in the SMTP LOGIN Auth part of go-mail as reported in #94. The changes introduced in https://github.com/wneessen/go-mail/commit/d0f04353a278126a74d998a7b48f35e4acb62a2c and https://github.com/wneessen/go-mail/commit/6a446bd4bd12fa0275f184ac84b397ffaa16dad5 caused issues with SMTP servers like ProtonMail Bridge, which respond with non-normative messages.
Thanks to @james-d-elliott from the Authelia team for the investigation and report.
Full Changelog: https://github.com/wneessen/go-mail/compare/v0.3.7...v0.3.8
This release introduces the SendError type which satisfies the error interface and provides a better way to identify delivery errors. A new sendError
This release introduces the SendError type which satisfies the error interface and provides a better way to identify delivery errors. A new sendError field has been added to the Msg as well, to also allow per-message error handling in bulk mailings.
We've also added different SendErrReason that indicate the different things that can go wrong during mail delivery. These reasons can be checked for, for each Msg using the errors.Is methods. Alternatively, the errors.As method can be used to unwrap the SendError to get access to it's methods. The SendError provides a IsTemp method that returns true if the delivery error is of temporary nature.
This is useful for delivery retries. For example the following code could be used to decide whether the error is retryable or not:
if err := c.DialAndSend(m); err != nil {
var se *mail.SendError
if errors.As(err, &se) && se.IsTemp() {
// retryable error
log.Printf("temporary error, will re-try")
/*
perform some re-try logic here
*/
}
// permanent error
log.Fatal(err)
}
If the Send method runs into more than one error during delivery, these errors are accumulated and returned with the reason ErrAmbiguous, since it's not possible to exactly say what caused the error. For this it comes handy, that the *Msg now provides per-message send errors. The *Msg now has HasSendError(), SendErrorIsTemp() and SendError(). While HasSendError() simply returns a bool in case a *Msg failed during delivery and SendErrorIsTemp() returns true if it's a temporary error, the SendError() will return the full SendError error of the corresponding *Msg.
The Error() method of SendError will return a detailed error string based on the accumulated errors that were collected during the delivery.
Thanks to @imirkin and @iwittkau for providing valueable feedback and performing code review on the PR.
Full Changelog: https://github.com/wneessen/go-mail/compare/v0.3.6...v0.3.7
This release is mainly a bugfix release but also introduces slight improvements.
This release is mainly a bugfix release but also introduces slight improvements.
One major bugfix is in Client.Send(), not sending all mails in case an error occured during a bulk mailing. Client.Send() provides the possibility to send multiple *Msg in one go. If one of the *Msg caused an error with the sending mail server, we were returning completely, while not processing any *Msg that came after the failing message.
This release fixes this behaviour by processing each message first and then return a accumulated error in case any of the *Msg processing failed
Additionally, this release separates the Client.Send() method into two different versions. One that makes use of the new errors.Join() functionality that is introduced with Go 1.20 and one that handles it the old way for any supported version lower than Go 1.20
Also welcome @james-d-elliott as new contributor to the project, providing a bugfix in the Client.Dialer and adding an option to disable NOOP calls. Thanks for the contribution, James!
Full Changelog: https://github.com/wneessen/go-mail/compare/v0.3.5...v0.3.6
SetHeader and SetHeaderPreformatted have been deprecated in favour of SetGenHeader and SetGenHeaderPreformatted As pointed out in #80 the naming was p…
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.
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.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 typeNOTE; We encourage users who use the SetHeader method in their code to switch to SetGenHeader instead.
Full Changelog: https://github.com/wneessen/go-mail/compare/v0.3.4...v0.3.5
This release introduces a bugfix and an enhancement:
This release introduces a bugfix and an enhancement:
SetHeaderPreformatted has been introduced, which allows the user to set a message header with preformated text. The header will not be altered during the mail message processing/output. More details in #77Full Changelog: https://github.com/wneessen/go-mail/compare/v0.3.3...v0.3.4
Nothing published for this version
For middlewares to be able to access the fully written mail message, we need a way to execute WriteTo without the calling middleware to be handled, ot
For middlewares to be able to access the fully written mail message, we need a way to execute WriteTo without the calling middleware to be handled, otherwise we end up in an infinite loop.
This release introduces the MiddlewareType and the corresponding change of the Middleware interface. We now require to return the MiddlewareType when the Type() method on the interface is called. Conveniently MiddlewareType is an alias to a string.
This way we can also introduce the WriteToSkipMiddleware() method which takes a MiddlewareType as argument. This will allow us to use a WriteTo call with the initiating Middleware itself to be skipped.
Please note: This release will break any existing go-mail Middleware, since they don't provide a Type() method yet.
Full Changelog: https://github.com/wneessen/go-mail/compare/v0.3.2...v0.3.3
BREAKING CHANGE: Since we remove the Read method from the Msg the Msg does not satisfy the io.Reader interface anymore, which is considered a breaking…
Initially the Msg implemented a io.Reader interface by providing a Read methods. Unfortunately the method chosen for this method was very naive. It works fine for smaller messages but could result in wrong data returned for larger messages or i. e. used in a bufio.Reader with non consecutive reads. Since we did not track the position and state of the reading operation, duplicate data might be returned to the caller eventually even leading into infinite loops.
This release fixes the issue be introducing a new Reader type. The Reader type satisfies the io.Reader interface and returns the data properly as well as returns EOF in case the end of data is reached.
The initial Read() method has been removed from the Msg type and instead a NewReader() method has been introduced that returns the Reader type.
BREAKING CHANGE: Since we remove the Read method from the Msg the Msg does not satisfy the io.Reader interface anymore, which is considered a breaking change. But given that the returned data of the original implementation might return duplicate or wrong data, this breaking change is considered as the right decision.
Full Changelog: https://github.com/wneessen/go-mail/compare/v0.3.1...v0.3.2
This release introduces a couple of new methods on the Msg, which will help the Msg.Middleware to deal with Msg attachments.
This release introduces a couple of new methods on the Msg, which will help the Msg.Middleware to deal with Msg attachments.
To get the Msg attachments, we can now use the Msg.GetAttachments() methods to get the list of currently assigned attachments to the Msg.
To set the Msg attachments, we can now use the Msg.SetAttachments() methods to set a list of *File as Msg attachments.
Full Changelog: https://github.com/wneessen/go-mail/compare/v0.3.0...v0.3.1
Nothing published for this version
This release introduces a couple of new methods on the Msg as well as the Part. This will help the Msg.Middleware to be more extensible since we allow
This release introduces a couple of new methods on the Msg as well as the Part. This will help the Msg.Middleware to be more extensible since we allow access not only to headers but also to body parts.
To get the Msg body parts, one can now utilize the Msg.GetParts() methods to get the list of currently assigned message parts to the Msg.
Each Part has now an additional list of getters/setters, to read and modify the given part:
Part.GetContent(): get the parts contentPart.GetContentType(): get the parts content typePart.GetEncoding(): get the parts encodingPart.GetWriteFunc(): get the parts write functionEach of these Part.Get*() methods also has an corresponding Part.Set*() methods what overrides the current value
This release is a very minor release. It only adds Msg.GetGenHeader() so that 3rd party middleware can access already set generic headers, in case the
This release is a very minor release. It only adds Msg.GetGenHeader() so that 3rd party middleware can access already set generic headers, in case they want to alter them.
This release is important though, since it adds information about a new Middlware repository we started: https://github.com/wneessen/go-mail-middleware. A collection of useful middlewares that can be used with go-mail. A specific section has been added to the README.
Msg.GetGenHeader() methodOne column per quarter.