mailer

package
v0.0.0-...-75e7317 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMailersFromConfig

func NewMailersFromConfig(config *fs.MailConfig) ([]fs.Mailer, error)

func NewSMTPMailer

func NewSMTPMailer(name string, config *SMTPConfig) (fs.Mailer, error)

Types

type Backend

type Backend struct {
	Usernames []string
	Passwords []string
	Froms     []string
	Rcpts     []string
	Messages  [][]byte
}

func (*Backend) NewSession

func (b *Backend) NewSession(_ *smtp.Conn) (smtp.Session, error)

type MockSMTPServer

type MockSMTPServer struct {
	Host    string
	Port    int
	Close   func() error
	Backend *Backend
}

func CreateMockSMTPServer

func CreateMockSMTPServer(addresses ...string) (_ *MockSMTPServer, err error)

type SMTPConfig

type SMTPConfig struct {
	DefaultSenderName string
	DefaultSenderMail string
	Host              string
	Port              int
	Username          string
	Password          string
	Insecure          bool
}

type SMTPMailer

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

func (*SMTPMailer) Driver

func (s *SMTPMailer) Driver() string

func (*SMTPMailer) Name

func (s *SMTPMailer) Name() string

func (*SMTPMailer) Send

func (s *SMTPMailer) Send(content *fs.Mail, froms ...mail.Address) error

type Session

type Session struct{ *Backend }

func (*Session) Auth

func (s *Session) Auth(mech string) (sasl.Server, error)

func (*Session) AuthMechanisms

func (s *Session) AuthMechanisms() []string

func (*Session) Data

func (s *Session) Data(r io.Reader) error

func (*Session) Logout

func (*Session) Logout() error

func (*Session) Mail

func (s *Session) Mail(from string, _ *smtp.MailOptions) error

func (*Session) Rcpt

func (s *Session) Rcpt(to string, _ *smtp.RcptOptions) error

func (*Session) Reset

func (*Session) Reset()

Jump to

Keyboard shortcuts

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