email

package
v0.0.0-...-0bc05a2 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Normalize

func Normalize(email string) (string, error)

Types

type DefaultSender

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

DefaultSender implements the Sender interface.

func NewSender

func NewSender(c config.SMTP) DefaultSender

NewSender returns a new DefaultSender that uses the given SMTP config.

func (DefaultSender) Send

func (sender DefaultSender) Send(to, subject, body string) error

Send sends the given body to the to address with the given subject.

type Email

type Email struct {
	From    string
	To      string
	Subject string
	Header  map[string]string
	Body    string
}

Email is the structure of an email

func (Email) String

func (email Email) String() string

String returns the string ready to be passed to a Sender.Send()

type Sender

type Sender interface {
	Send(to, subject, body string) error
}

Sender is a common interface for sending emails.

Jump to

Keyboard shortcuts

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