smtp

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorParamEmpty liberr.CodeError = iota + liberr.MinPkgSMTP
	ErrorSMTPDial
	ErrorSMTPClientInit
	ErrorSMTPClientStartTLS
	ErrorSMTPClientAuth
	ErrorSMTPClientNoop
	ErrorSMTPClientMail
	ErrorSMTPClientRcpt
	ErrorSMTPClientData
	ErrorSMTPClientWrite
	ErrorSMTPLineCRLF
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SMTP

type SMTP interface {
	Clone() SMTP
	Close()

	UpdConfig(cfg smtpcf.SMTP, tslConfig *tls.Config)

	Client(ctx context.Context) (*smtp.Client, error)
	Check(ctx context.Context) error
	Send(ctx context.Context, from string, to []string, data io.WriterTo) error

	Monitor(ctx libctx.FuncContext, vrs libver.Version) (montps.Monitor, error)
}

func New added in v1.10.0

func New(cfg smtpcf.SMTP, tlsConfig *tls.Config) (SMTP, error)

New return a SMTP interface to operation negotiation with a SMTP server. the dsn parameter must be string like this '[user[:password]@][net[(addr)]]/tlsmode[?param1=value1&paramN=valueN]".

  • params available are : ServerName (string), SkipVerify (boolean).
  • tls mode acceptable are : starttls, tls, <any other value to no tls/startls>.
  • net acceptable are : tcp4, tcp6, unix.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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