mailer

package
v0.78.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package mailer sends transactional email (password reset, email verification, invites) over SMTP. It's intentionally tiny: stdlib net/smtp with STARTTLS, no external deps. When no host is configured it's "disabled" — Enabled() returns false and callers fall back to surfacing a copyable link instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mailer

type Mailer struct {
	// contains filtered or unexported fields
}

func New

func New(cfg config.SMTPConfig) *Mailer

func (*Mailer) Enabled

func (m *Mailer) Enabled() bool

Enabled reports whether SMTP is configured enough to send.

func (*Mailer) Send

func (m *Mailer) Send(to, subject, htmlBody string) error

Send delivers a single HTML email. Uses STARTTLS on the standard submission flow; returns an error the caller can log (the flow then still succeeds with a neutral response so it doesn't leak whether an address exists).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL