smtpmail

package
v4.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package smtpmail sends mail through a relay. It is the adapter: the only package that knows this app's messages leave over SMTP.

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 talks to one relay. Constructing it connects to nothing: boot validates what is local and stops there, so a relay being down is a message that waits in the outbox rather than a process that will not start.

func New

func New(addr, from, user, password string) *Sender

New returns a sender for the relay at addr. A user of "" means the relay wants no credentials, which is the usual shape for a relay on localhost.

func (*Sender) Send

func (s *Sender) Send(ctx context.Context, m domain.Mail) error

Send delivers one message, or returns why it could not.

net/smtp is frozen and its SendMail takes no context, so the connection is dialled here instead: a relay that accepts the TCP connection and then says nothing would otherwise hold this goroutine open past shutdown.

Jump to

Keyboard shortcuts

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