mail

package
v0.7.9 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mail

type Mail struct {
	To      string
	Subject string
	Body    string
}

Mail represents a mail

type SMTPConfig

type SMTPConfig struct {
	Address  string
	Port     int
	User     string
	Helo     string
	Password []byte
}

SMTPConfig holds the configuration for the SMTP server

type Sender added in v0.3.1

type Sender interface {
	Send(m Mail) error
	SendAsync(m Mail)
}

type Service

type Service struct {
	SubjectPrefix string
	SMTPConfig    SMTPConfig
	From          string
}

Service holds configuration for the SMTP server The sender address and an optional subject prefix

func NewMailService

func NewMailService(subjectPrefix, from string, smtpConfig SMTPConfig) Service

NewMailService returns a new Service with specified config

func (Service) Send

func (s Service) Send(m Mail) error

Send sends a mail over the configured SMTP server

func (Service) SendAsync

func (s Service) SendAsync(m Mail)

Jump to

Keyboard shortcuts

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