transport

package
v0.0.0-...-a942fbd Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoginAuth

func LoginAuth(username string, password string, host ...string) smtp.Auth

Types

type MailTransporter

type MailTransporter interface {
	Send(mail *email.Email) error
}

type MockMailTransport

type MockMailTransport struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewMock

func NewMock() *MockMailTransport

func (*MockMailTransport) GetLastSentMail

func (m *MockMailTransport) GetLastSentMail() *email.Email

func (*MockMailTransport) GetSentMails

func (m *MockMailTransport) GetSentMails() []*email.Email

func (*MockMailTransport) Send

func (m *MockMailTransport) Send(mail *email.Email) error

type SMTPAuthType

type SMTPAuthType int
const (
	// SMTPAuthTypeNone indicates no SMTP authentication should be performed.
	SMTPAuthTypeNone SMTPAuthType = iota
	// SMTPAuthTypePlain indicates SMTP authentication should be performed using the "AUTH PLAIN" protocol.
	SMTPAuthTypePlain
	// SMTPAuthTypeCRAMMD5 indicates SMTP authentication should be performed using the "CRAM-MD5" protocol.
	SMTPAuthTypeCRAMMD5
	// SMTPAuthTypeLogin indicates SMTP authentication should be performed using the "LOGIN" protocol.
	SMTPAuthTypeLogin
)

func SMTPAuthTypeFromString

func SMTPAuthTypeFromString(s string) SMTPAuthType

func (SMTPAuthType) String

func (t SMTPAuthType) String() string

type SMTPMailTransport

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

func (*SMTPMailTransport) Send

func (m *SMTPMailTransport) Send(mail *email.Email) error

type SMTPMailTransportConfig

type SMTPMailTransportConfig struct {
	Host      string
	Port      int
	AuthType  SMTPAuthType `json:"-"` // iota
	Username  string
	Password  string `json:"-"` // sensitive
	UseTLS    bool
	TLSConfig *tls.Config `json:"-"` // pointer
}

Jump to

Keyboard shortcuts

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