smtp

package
v0.22.10 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DebugSender

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

func NewDebugSender

func NewDebugSender(writer io.Writer) *DebugSender

func (*DebugSender) Ping

func (sender *DebugSender) Ping() error

func (*DebugSender) SendMail

func (sender *DebugSender) SendMail(_ MailUsers, t *template.Template, tName string, data any) error

type MailUser

type MailUser struct {
	Name  string
	Email string
}

func (MailUser) String

func (mailUser MailUser) String() string

type MailUsers

type MailUsers []MailUser

func (MailUsers) Emails

func (mailUsers MailUsers) Emails() []string

func (MailUsers) String

func (mailUsers MailUsers) String() string

type ProdSender

type ProdSender struct {
	Addr   string `json:"addr"   yaml:"addr"`
	Name   string `json:"name"   yaml:"name"`
	Email  string `json:"email"  yaml:"email"`
	Domain string `json:"domain" yaml:"domain"`

	Password string `json:"-" yaml:"-"`

	// Dangerous setting, only use it for local development.
	ForceUnencryptedTls bool `json:"forceUnencryptedTLS" yaml:"forceUnencryptedTLS"`
}

func (*ProdSender) Ping

func (sender *ProdSender) Ping() error

func (*ProdSender) SendMail

func (sender *ProdSender) SendMail(to MailUsers, t *template.Template, tName string, data any) error

type Sender

type Sender interface {
	SendMail(to MailUsers, t *template.Template, tName string, data any) error
	Ping() error
}

Directories

Path Synopsis
Package smtptest provides an in-memory implementation of smtp.Sender for use in unit and integration tests.
Package smtptest provides an in-memory implementation of smtp.Sender for use in unit and integration tests.

Jump to

Keyboard shortcuts

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