mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-08 23:12:54 +01:00
2 KiB
2 KiB
go-mail - Simple and easy way to send mails in Go
The main idea of this library was to provide a simple interface to sending mails for my JS-Mailer project. It quickly evolved into a full-fledged mail library.
go-mail follows idiomatic Go style and best practice. It's only dependency is the Go Standard Library. It combines a lot of functionality from the standard library to give easy and convenient access to mail and SMTP related tasks.
Parts of this library (especially some parts of msgwriter.go) have been forked/ported from the go-mail/mail respectively go-gomail/gomail which both seems to not be maintained anymore.
Features
Some of the features of this library:
- Only Standard Library dependant
- Modern, idiomatic Go
- Sane and secure defaults
- SSL/TLS support
- StartTLS support with different policies
- Makes use of contexts for a better control flow and timeout/cancelation handling
- SMTP Auth support (LOGIN, PLAIN, CRAM-MD5, DIGEST-MD5)
- RFC5322 compliant mail address validation
- Support for common mail header field generation (Message-ID, Date, Bulk-Precedence, etc.)
- Reusing the same SMTP connection to send multiple mails
- Support for attachments and inline embeds
- Support for different encodings
Examples
The package is shipped with example code. Check it out on the packages GoDoc page