email

package
v0.6.26 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: AGPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSMTPNoSet          = errors.New(`SMTP is not set`)
	ErrSenderNoSet        = errors.New(`The sender address is not set`)
	ErrRecipientNoSet     = errors.New(`The recipient address is not set`)
	ErrSendChannelTimeout = errors.New(`SendMail: The sending channel timed out`)

	//QueueSize 每批容量
	QueueSize = 50
	//QueueWait 队列等待时间
	QueueWait = time.Second * 30
)
View Source
var Callbacks = []func(*Config, error){}

Functions

func AddCallback

func AddCallback(cb func(*Config, error))

func Initial

func Initial(queueSizes ...int)

func SMTPClient

func SMTPClient(conf *mail.SMTPConfig) *mail.SMTPClient

func SendMail

func SendMail(conf *Config) error

Types

type Config

type Config struct {
	ID         uint64 //RequestID
	Engine     string
	SMTP       *mail.SMTPConfig
	From       string
	ToAddress  string
	ToUsername string
	Subject    string
	Content    []byte
	CcAddress  []string
	Auth       smtp.Auth
	Timeout    int64
	Noticer    notice.Noticer
}

Jump to

Keyboard shortcuts

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