email

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 7 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

View Source
const SequenceKey ctxKey = "sequence"

SequenceKey is the context key runSend() uses to pass each broker's position in the current batch through to a Sender, so implementations (e.g. the SMTP sender) can fold it into a generated message ID.

Variables

This section is empty.

Functions

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 (*SMTPSender) Name

func (s *SMTPSender) Name() string

func (*SMTPSender) Send

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

type Sender

type Sender interface {
	Send(ctx context.Context, msg Message) Result
	Name() string
}

func NewSender

func NewSender(cfg config.EmailConfig) (Sender, error)

Jump to

Keyboard shortcuts

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