smtpx

package
v0.94.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: AGPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Send

func Send(host string, port int, username, password, from string, recipients []string, subject, body string) error

Send an email using SMTP

func SetSender

func SetSender(sender Sender)

SetSender sets the sender used by Send

Types

type MockSender

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

MockSender is a mocked sender for testing that just logs would-be commands

func NewMockSender

func NewMockSender(err string) *MockSender

func (*MockSender) Logs

func (s *MockSender) Logs() []string

func (*MockSender) Send

func (s *MockSender) Send(host string, port int, username, password, from string, recipients []string, subject, body string) error

type Sender

type Sender interface {
	Send(host string, port int, username, password, from string, recipients []string, subject, body string) error
}

Sender is anything that can send an email

var DefaultSender Sender = defaultSender{}

DefaultSender is the default SMTP sender

Jump to

Keyboard shortcuts

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