email

package
v0.0.0-...-8357697 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Emailer

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

Emailer is the SMTP e-mail messenger.

func New

func New(servers ...Server) (*Emailer, error)

New returns an SMTP e-mail Messenger backend with the given SMTP servers.

func (*Emailer) Close

func (e *Emailer) Close() error

Close closes the SMTP pools.

func (*Emailer) Flush

func (e *Emailer) Flush() error

Flush flushes the message queue to the server.

func (*Emailer) Name

func (e *Emailer) Name() string

Name returns the Server's name.

func (*Emailer) Push

func (e *Emailer) Push(m models.Message) error

Push pushes a message to the server.

type Server

type Server struct {
	Username      string            `json:"username"`
	Password      string            `json:"password"`
	AuthProtocol  string            `json:"auth_protocol"`
	TLSType       string            `json:"tls_type"`
	TLSSkipVerify bool              `json:"tls_skip_verify"`
	EmailHeaders  map[string]string `json:"email_headers"`

	// Rest of the options are embedded directly from the smtppool lib.
	// The JSON tag is for config unmarshal to work.
	smtppool.Opt `json:",squash"`
	// contains filtered or unexported fields
}

Server represents an SMTP server's credentials.

Jump to

Keyboard shortcuts

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