email

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRecipients       = errors.New("sms4go/email: no recipients")
	ErrMonitorUnsupported = errors.New("sms4go/email: IMAP monitoring requires an IMAP client dependency")
)

Functions

This section is empty.

Types

type Blacklist

type Blacklist interface {
	GetBlacklist() []string
}

type Client

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

func NewClient

func NewClient(config SMTPConfig, blacklist Blacklist) *Client

func (*Client) Send

func (c *Client) Send(message Message) error

type IMAPConfig

type IMAPConfig struct {
	IMAPServer  string
	Username    string
	AccessToken string
	Cycle       time.Duration
}

type Message

type Message struct {
	To          []string
	Title       string
	Body        string
	HTMLContent string
	HTMLValues  map[string]string
	CC          []string
	BCC         []string
	Files       map[string]string
	ZipName     string
}

type Monitor

type Monitor func(MonitorMessage) bool

type MonitorMessage

type MonitorMessage struct {
	Title        string
	Text         string
	HTMLText     string
	SendDate     time.Time
	FromAddress  string
	MessageIndex int
	AcceptTime   time.Time
}

type MonitorService

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

func NewMonitorService

func NewMonitorService(config IMAPConfig, monitor Monitor) *MonitorService

func (*MonitorService) Start

func (m *MonitorService) Start() error

func (*MonitorService) Stop

func (m *MonitorService) Stop()

type SMTPConfig

type SMTPConfig struct {
	Port          string
	FromAddress   string
	NickName      string
	SMTPServer    string
	Username      string
	Password      string
	SSL           bool
	Auth          bool
	RetryInterval time.Duration
	MaxRetries    int
}

Jump to

Keyboard shortcuts

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