mail

package
v0.0.0-...-7ee5b46 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MPL-2.0 Imports: 22 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(
	server,
	port,
	username,
	password string,
	rootCAs *x509.CertPool,
	from mail.Address,
	logger blog.Logger,
	stats prometheus.Registerer,
	reconnectBase time.Duration,
	reconnectMax time.Duration) *mailerImpl

New constructs a Mailer to represent an account on a particular mail transfer agent.

func NewDryRun

func NewDryRun(from mail.Address, logger blog.Logger) *mailerImpl

NewDryRun constructs a Mailer suitable for doing a dry run. It simply logs each command that would have been run, at debug level.

Types

type BadAddressSMTPError

type BadAddressSMTPError struct {
	Message string
}

BadAddressSMTPError is returned by SendMail when the server rejects a message but for a reason that doesn't prevent us from continuing to send mail. The error message contains the error code and the error message returned from the server.

func (BadAddressSMTPError) Error

func (e BadAddressSMTPError) Error() string

type Conn

type Conn interface {
	SendMail([]string, string, string) error
	Close() error
}

Conn is an interface that allows sending mail. When you are done with a Conn, call Close(). Implementations are not required to be safe for concurrent use.

type Mailer

type Mailer interface {
	Connect() (Conn, error)
}

Mailer is an interface that allows creating Conns. Implementations must be safe for concurrent use.

Jump to

Keyboard shortcuts

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