mail

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIMEText = "text/plain"
	MIMEHTML = "text/html"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Name   string
	Data   []byte
	Inline bool
}
type Header struct {
	Key   string
	Value string
}

type Mail

type Mail struct {
	From        mail.Address
	To          []string
	CC          []string
	BCC         []string
	ReplyTo     string
	Subject     string
	Content     string
	ContentType string
	Headers     []Header
	Attachments []Attachment
}

func (*Mail) AttachData

func (m *Mail) AttachData(name string, data []byte, inline bool)

func (*Mail) AttachFile

func (m *Mail) AttachFile(filePath string, inline bool) (err error)

func (*Mail) Build

func (m *Mail) Build() (data []byte, err error)

func (*Mail) Receivers

func (m *Mail) Receivers() []string

type Sender

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

func NewSender

func NewSender(addr, username, password string) *Sender

func (*Sender) Send

func (s *Sender) Send(m Mail) (err error)

func (*Sender) SendHTML

func (s *Sender) SendHTML(from mail.Address, to []string, subject string, content string) error

func (*Sender) SendText

func (s *Sender) SendText(from mail.Address, to []string, subject string, content string) error

Jump to

Keyboard shortcuts

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