Send transactional emails, password resets, order confirmations, from a Go web app.
Attach files and embed images in HTML emails sent from a Go backend.
Send bulk emails efficiently by reusing a single SMTP connection instead of reconnecting for each message.
Plug in a custom sender to route emails through a third-party email API or local mail server.
No external dependencies from Go 1.5+, only needs an SMTP server or API credentials.
Gomail is a Go library that lets developers send emails from their applications. It connects to an SMTP server, which is the standard protocol most email providers use to receive outgoing mail, and handles the actual delivery from there. The project promises stable versions, meaning code you write against it today will not break when the library is updated. The library covers the most common email needs: plain text and HTML message bodies, file attachments, images embedded directly in the email, secure connections over SSL and TLS, and correct handling of special characters so messages arrive without garbled text. It can also reuse a single SMTP connection to send a batch of messages, which is faster and less wasteful than opening a new connection for every email. For cases where SMTP is not the right fit, such as sending through a local mail server or a third-party email API, the library is designed to accept custom sending methods. That flexibility means it can fit into many different server setups without forcing a specific infrastructure choice. The README is short and direct. It points to external documentation for full usage examples and covers one common error people encounter: a security certificate warning that can appear when the SMTP server uses a certificate not recognized by the system. The workaround shown in the docs disables certificate checking, and the README explicitly warns that this approach is not safe for production use. The project requires Go version 1.2 or newer. From Go 1.5 onward, it has no external package dependencies, so adding it to a project does not pull in additional third-party code.
← go-gomail on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.