mail

package
v0.0.0-...-e77b886 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2017 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mailer

type Mailer interface {
	SendMail([]string, string, string) error
	Connect() error
	Close() error
}

Mailer provides the interface for a mailer

type MailerImpl

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

MailerImpl defines a mail transfer agent to use for sending mail. It is not safe for concurrent access.

func New

func New(
	server,
	port,
	username,
	password string,
	from mail.Address,
	logger blog.Logger,
	stats metrics.Scope,
	reconnectBase time.Duration,
	reconnectMax time.Duration) *MailerImpl

New constructs a Mailer to represent an account on a particular mail transfer agent.

func NewDryRun

func NewDryRun(from mail.Address, logger blog.Logger) *MailerImpl

New constructs a Mailer suitable for doing a dry run. It simply logs each command that would have been run, at debug level.

func (*MailerImpl) Close

func (m *MailerImpl) Close() error

Close closes the connection.

func (*MailerImpl) Connect

func (m *MailerImpl) Connect() error

Connect opens a connection to the specified mail server. It must be called before SendMail.

func (*MailerImpl) SendMail

func (m *MailerImpl) SendMail(to []string, subject, msg string) error

SendMail sends an email to the provided list of recipients. The email body is simple text.

Jump to

Keyboard shortcuts

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