Versions in this module Expand all Collapse all v0 v0.1.0 Oct 8, 2026 Changes in this version + const HTMLSuffix + const SubjectSuffix + const TextSuffix + var ErrAuth = errors.New("omnimail: authentication failed") + var ErrInvalidAddress = errors.New("omnimail: invalid address") + var ErrInvalidMessage = errors.New("omnimail: invalid message") + var ErrRejected = errors.New("omnimail: rejected") + var ErrThrottled = errors.New("omnimail: throttled") + var ErrTransient = errors.New("omnimail: transient failure") + func IsRetryable(err error) bool + func ReservedHeader(name string) bool + func RetryAfter(err error) time.Duration + func ValidateMessage(msg *Message) error + type Address struct + Email string + Name string + func MustParseAddress(s string) Address + func ParseAddress(s string) (Address, error) + func ParseAddressList(s string) ([]Address, error) + func (a Address) Domain() string + func (a Address) IsASCII() bool + func (a Address) String() string + func (a Address) Validate() error + type BuildOptions struct + Boundary string + Date time.Time + MessageID string + MessageIDDomain string + type Error struct + Code string + Err error + Field string + Kind Kind + Message string + Provider string + RetryAfter time.Duration + func NewError(kind Kind, provider string, err error) *Error + func (e *Error) Error() string + func (e *Error) Is(target error) bool + func (e *Error) Retryable() bool + func (e *Error) Temporary() bool + func (e *Error) Unwrap() error + type Kind int + const KindAuth + const KindInvalidAddress + const KindInvalidMessage + const KindRejected + const KindThrottled + const KindTransient + const KindUnknown + func KindOf(err error) Kind + func Kinds() []Kind + func (k Kind) String() string + type MIMEMessage struct + Data []byte + MessageID string + func BuildMIME(msg *Message, opts BuildOptions) (*MIMEMessage, error) + type Message struct + Bcc []Address + Cc []Address + From Address + HTML string + Headers map[string]string + IdempotencyKey string + ReplyTo []Address + Subject string + Tags map[string]string + Text string + To []Address + func (m *Message) Clone() *Message + func (m *Message) Recipients() []Address + func (m *Message) Validate() error + type Rendered struct + HTML string + Subject string + Text string + type SendResult struct + MessageID string + Provider string + type Sender interface + Send func(ctx context.Context, msg *Message) (*SendResult, error) + type SenderFunc func(ctx context.Context, msg *Message) (*SendResult, error) + func (f SenderFunc) Send(ctx context.Context, msg *Message) (*SendResult, error) + type Template struct + func ParseTemplate(name string, src TemplateSource, opts ...TemplateOption) (*Template, error) + func ParseTemplateFS(fsys fs.FS, name string, opts ...TemplateOption) (*Template, error) + func (t *Template) Apply(msg *Message, data any) error + func (t *Template) Name() string + func (t *Template) Render(data any) (*Rendered, error) + type TemplateOption func(*templateConfig) + func WithDelims(left, right string) TemplateOption + func WithFuncs(funcs map[string]any) TemplateOption + type TemplateSource struct + HTML string + Subject string + Text string