mailer

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Overview

Package email is a minimal SMTP sender for the in-app auth flows (magic-link, email verification, password reset, invites). It speaks explicit STARTTLS to the configured server (e.g. smtp.gmail.com:587) using an app password from the environment, so the credential never crosses the wire in cleartext. It satisfies auth.Mailer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sender

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

Sender holds SMTP configuration. The zero value (no host) is !Configured(), so email methods disable cleanly when SMTP isn't set up.

func FromEnv

func FromEnv() *Sender

FromEnv builds a Sender from SMTP_* environment variables.

func (*Sender) Configured

func (s *Sender) Configured() bool

Configured reports whether enough is set to send mail.

func (*Sender) Send

func (s *Sender) Send(to, subject, htmlBody, textBody string) error

Send delivers a multipart text+html message over STARTTLS. TLS is required.

Jump to

Keyboard shortcuts

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