email

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2019 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Send

func Send(addr string, auth smtp.Auth, m *Message) error

Types

type Attachment

type Attachment struct {
	Filename string
	Data     []byte
	Inline   bool
}

type Message

type Message struct {
	From            string
	To              []string
	Cc              []string
	Bcc             []string
	ReplyTo         string
	Subject         string
	Body            string
	BodyContentType string
	Attachments     map[string]*Attachment
}

func NewBooking

func NewBooking(from, subject string, body *bytes.Buffer) *Message

func NewConform

func NewConform(subject string, body *bytes.Buffer, pdfName string, pdf []byte) *Message

func NewContact

func NewContact(from, subject string, body *bytes.Buffer) *Message

func NewHTMLMessage

func NewHTMLMessage(subject string, body string) *Message

NewMessage returns a new Message that can compose an HTML email with attachments

func NewInvoice

func NewInvoice(subject string, body *bytes.Buffer, pdfName string, pdf []byte) *Message

func NewMessage

func NewMessage(subject string, body string) *Message

NewMessage returns a new Message that can compose an email with attachments

func NewTocht added in v0.4.2

func NewTocht(subject string, body *bytes.Buffer, pdfName string, pdf []byte) *Message

func (*Message) Attach

func (m *Message) Attach(file string) error

func (*Message) AttachBytes

func (m *Message) AttachBytes(file string, data []byte)

func (*Message) Bytes

func (m *Message) Bytes() []byte

Bytes returns the mail data

func (*Message) Do

func (m *Message) Do(rcpts []string) error

Do sends an email message using the default to and from.

func (*Message) Inline

func (m *Message) Inline(file string) error

func (*Message) InlineBytes

func (m *Message) InlineBytes(file string, data []byte)

func (*Message) Tolist

func (m *Message) Tolist() []string

ToList returns all the recipients of the email

Jump to

Keyboard shortcuts

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