email

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendRemoval added in v0.9.0

func SendRemoval(ctx context.Context, s *SMTPSender, eng *template.Engine, tmpl string, np config.NamedProfile, from string, b broker.Broker) (*history.Record, error)

SendRemoval renders the removal request for b, sends it from `from`, and returns the history record for the attempt (sent or failed) for the caller to store. A render failure returns an error and no record: nothing was attempted.

func ValidateEmail

func ValidateEmail(email string) error

ValidateEmail checks for injection characters and RFC 5322 compliance

Types

type Message

type Message struct {
	To      string
	From    string
	Subject string
	Body    string
}

type Result

type Result struct {
	Success   bool
	MessageID string
	Error     error
}

type SMTPSender

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

func NewSMTPSender

func NewSMTPSender(cfg config.SMTPConfig, from string) *SMTPSender

func NewSender

func NewSender(cfg config.EmailConfig) (*SMTPSender, error)

NewSender builds the sender for cfg. SMTP is the only provider; the check exists so a stale provider: line in config.yaml fails loudly instead of silently sending over SMTP anyway.

func (*SMTPSender) Send

func (s *SMTPSender) Send(ctx context.Context, msg Message) Result

Jump to

Keyboard shortcuts

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