email

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectSMTP

func ConnectSMTP(cfg config.SMTPConfig) (*smtp.Client, error)

ConnectSMTP establishes a persistent, authenticated SMTP client with TLS.

func SendWithClient

func SendWithClient(client *smtp.Client, cfg config.SMTPConfig, task Task) error

SendWithClient formats and delivers the email using an active SMTP client. It uses cfg.SMTP.From as both the envelope sender and header From address.

func SetRetryLimit

func SetRetryLimit(limit int)

SetRetryLimit sets the max retry attempts per failed email, with exponential backoff.

func StartDispatcher

func StartDispatcher(tasks []Task, cfg config.SMTPConfig, concurrency int, batchSize int)

StartDispatcher spawns workers and processes email tasks with retries and batch-mode dispatch.

Types

type Task

type Task struct {
	Recipient   parser.Recipient
	Subject     string
	Body        string
	Retries     int
	Attachments []string
}

Task represents an email send job with recipient data.

Jump to

Keyboard shortcuts

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