Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. go-mail

go-mail

MITGov0.8.1

A comprehensive and idiomatic Go library for sending emails with SMTP, attachments, templates, and extensive security features.

Visit WebsiteGitHubGitHub
1.5k stars108 forks0 contributors

What is go-mail?

go-mail is a feature-rich email library for Go that provides a simple yet powerful interface for sending emails programmatically. It combines functionality from the Go standard library with modern extensions to offer a robust solution for mail and SMTP tasks while maintaining a small dependency footprint.

Target Audience

Go developers building applications that require programmatic email sending, such as notification systems, marketing tools, or automated reporting services.

Value Proposition

Developers choose go-mail for its comprehensive feature set, including multiple SMTP authentication methods, security features like DKIM and S/MIME, and advanced delivery controls, all while adhering to idiomatic Go practices and minimizing external dependencies.

Overview

📧 Easy to use, yet comprehensive library for sending mails with Go

Use Cases

Best For

  • Building Go applications that need to send emails with various authentication methods like XOAUTH2 or SCRAM-SHA.
  • Implementing email functionality with strict security requirements, including DKIM signatures and S/MIME signing.
  • Sending emails with rich message composition, such as attachments from multiple sources and template support.
  • Developing systems that require advanced SMTP control, like connection reuse, custom dial functions, or UNIX domain socket support.
  • Creating email debugging or logging tools that need to output messages as .eml files or parse EML files.
  • Building applications that require compliance with email standards, such as RFC5322 address validation and request for MDNs/DSNs.

Not Ideal For

  • Teams needing a high-level, managed email service API wrapper like SendGrid or Mailgun SDKs
  • Projects with minimal email requirements where the standard net/smtp package would suffice
  • Applications built in languages other than Go, as go-mail is specifically for Go ecosystems
  • Systems requiring built-in email queueing or batch sending management without additional custom code

Pros & Cons

Pros

Small Dependency Footprint

Relies primarily on the Go Standard Library, minimizing external dependencies and aligning with idiomatic Go practices, as emphasized in the philosophy.

Comprehensive Security Features

Supports DKIM signatures via middleware, S/MIME signing, and configurable TLS policies, ensuring secure email transmission for compliance-sensitive applications.

Advanced SMTP Control

Offers concurrency-safe connection reuse, custom dial functions, and UNIX domain socket support, providing fine-tuned delivery management for complex setups.

Rich Message Composition

Allows attachments from multiple sources like files, io.Reader, and embed.FS, plus template support for dynamic email content, enhancing flexibility.

Cons

No Built-in Service Integrations

Lacks direct abstractions for cloud email services, requiring manual SMTP configuration which can be cumbersome compared to service-specific SDKs.

Middleware Dependency for Key Features

Essential features like DKIM signatures are implemented via separate middleware, adding complexity and an extra layer of dependency management.

Steeper Learning Curve

With extensive configuration options and low-level controls, it can be overwhelming for developers with simple email needs, despite the documented examples.

Frequently Asked Questions

Quick Stats

Stars1,481
Forks108
Contributors0
Open Issues3
Last commit1 day ago
CreatedSince 2022

Tags

#hacktoberfest#mail#smtp#go-library#tls#golang-library#security#golang#dkim#templates#concurrency#email#go#middleware

Built With

G
Go

Links & Resources

Website

Included in

Go169.1k
Auto-fetched 10 hours ago

Related Projects

MailHogMailHog

Web and API based SMTP testing

Stars16,145
Forks1,181
Last commit2 years ago
MailpitMailpit

An email and SMTP testing tool with API for developers

Stars10,312
Forks337
Last commit2 days ago
MaddyMaddy

✉️ Composable all-in-one mail server.

Stars6,081
Forks326
Last commit6 days ago
moxmox

modern full-featured open source secure mail server for low-maintenance self-hosted email

Stars5,846
Forks222
Last commit1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub