email

package
v4.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	To              []string
	CC              []string
	BCC             []string
	Subject         string
	BodyContentType string // text/plain, text/html
	Body            string
	Attachments     []MessageAttachment
}

func NewMessage

func NewMessage(subject string, bodyContentType string, body string) Message

func (*Message) AttachFile

func (m *Message) AttachFile(src string, mime string, fileName string) error

func (*Message) AttachFileBytes

func (m *Message) AttachFileBytes(fileName string, mime string, content []byte)

func (*Message) ToBytes

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

type MessageAttachment

type MessageAttachment struct {
	FileName string
	Mime     string
	Content  []byte
}

type Sender

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

func NewSender

func NewSender(username string, password string, host string, port string) *Sender

func (*Sender) Send

func (s *Sender) Send(m Message) error

func (*Sender) SendBytes

func (s *Sender) SendBytes(to []string, b []byte) error

Jump to

Keyboard shortcuts

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