mailer

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LocaleDirFn func(lang string) string

Functions

func ApplyDirection

func ApplyDirection(html string, data interface{}) string

func IsPermanent

func IsPermanent(err error) bool

func SanitizeHeaderValue

func SanitizeHeaderValue(s string) string

func ValidateAddress

func ValidateAddress(raw string) (string, error)

Types

type Attachment

type Attachment struct {
	Filename    string
	ContentType string
	Content     []byte
}

type Config

type Config struct {
	Host           string
	Port           string
	User           string
	Pass           string
	Hostname       string
	DialTimeout    time.Duration
	SessionTimeout time.Duration
}

type Error

type Error struct {
	Stage string
	Err   error
	// contains filtered or unexported fields
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Mailer

type Mailer struct {
	ConfigFn func() (Config, error)
}

func New

func New(configFn func() (Config, error)) *Mailer

func (*Mailer) Send

func (m *Mailer) Send(msg Message) error

func (*Mailer) SendWithRetry

func (m *Mailer) SendWithRetry(p logger.RetryPolicy, msg Message) error

type Message

type Message struct {
	To          string
	From        Sender
	ReplyTo     string
	Subject     string
	HTML        string
	Text        string
	Attachments []Attachment
}

func (Message) Build

func (m Message) Build(now time.Time) (raw []byte, envelopeFrom, envelopeTo string, err error)

type Sender

type Sender struct {
	Name    string
	Address string
}

Jump to

Keyboard shortcuts

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