smtpbackend

package
v1.40.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package smtpbackend is the SMTP sending backend (ADR 0037).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host        string
	Port        int
	Security    conn.Security
	Credentials backend.CredentialsFunc
}

Config is how to reach an account's SMTP server.

type Sender

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

Sender submits over SMTP, one connection per message. It does not save a sent copy: the outbox has the Receiver append one.

func New

func New(cfg Config) *Sender

New is a Sender on the server cfg reaches.

func (*Sender) Check

func (s *Sender) Check(ctx context.Context) error

Check signs in and hangs up, sending nothing: whether the server takes the account's credentials.

func (*Sender) SavesSent

func (*Sender) SavesSent() bool

func (*Sender) Send

func (s *Sender) Send(ctx context.Context, from string, rcpts []string, raw []byte) error

Send submits raw to rcpts, stopping at the first refused recipient. A mailbox whose SMTP AUTH is off is conn.ErrSMTPAuthDisabled (an ErrAuthFailed). Cancelling ctx closes the connection.

Jump to

Keyboard shortcuts

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