mail

package
v0.0.0-...-1b8d80d Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//NONE points a default person
	NONE = []schema.Person{}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Server   string
	Login    string
	Password string
	Sender   string
	Path     string
	Fullname string
}

Config configures the SMTP-based mailer

type Fake

type Fake struct {
	Config Config
	WWW    string
}

Fake to mock the mailing system

func (*Fake) Send

func (fake *Fake) Send(to schema.Person, tpl string, data interface{}, cc ...schema.Person) error

Send just print the mailing on stdout

type Mailer

type Mailer interface {
	//Send a mail to all the given person in to with cc'ing persons in cc.
	//The mail body is created using the given template and data
	Send(to schema.Person, tpl string, data interface{}, cc ...schema.Person) error
}

Mailer is an interface to specify a mail must be send

type SMTP

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

SMTP depicts a SMTP-based mailer

func NewSMTP

func NewSMTP(cfg Config, www string) (*SMTP, error)

NewSMTP creates a new SMTP mailer

func (*SMTP) Send

func (m *SMTP) Send(to schema.Person, tpl string, data interface{}, cc ...schema.Person) error

Send the mail to the smtp server

Jump to

Keyboard shortcuts

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