email

package
v5.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitSender added in v5.2.1

func InitSender(username string, password string, host string, port string)

Init initialize the global Email Sender singleton

Types

type Message

type Message struct {
	To              []string
	From            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 S added in v5.2.1

func S() *Sender

S is used to access the global Email 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