email

package
v0.0.0-...-9db4afe Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoginAuth

func LoginAuth(username, password string) smtp.Auth

Types

type Content

type Content struct {
	From        string    `json:"From"`
	To          string    `json:"To"`
	Cc          string    `json:"Cc"`
	Bcc         string    `json:"Bcc"`
	Subject     string    `json:"Subject"`
	ContentType string    `json:"Content-Type"`
	Date        time.Time `json:"Date"`
	Body        string    `json:"Body"`
}

func NewContent

func NewContent() *Content

func (*Content) Bytes

func (ctn *Content) Bytes() []byte

func (*Content) SetBody

func (ctn *Content) SetBody(body string) error

func (*Content) SetContentType

func (ctn *Content) SetContentType(ct string)

func (*Content) SetFrom

func (ctn *Content) SetFrom(user string)

func (*Content) SetSubject

func (ctn *Content) SetSubject(subject string)

func (*Content) SetTo

func (ctn *Content) SetTo(users string)

func (Content) String

func (ctn Content) String() string

type Email

type Email struct {
	Host     string `yaml:"host"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

func NewEmail

func NewEmail(host, username, password string) *Email

func (*Email) Send

func (e *Email) Send(content *Content) error

Jump to

Keyboard shortcuts

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