email

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 3 Imported by: 0

Documentation

Overview

Package email provides SMTP email sending.

Index

Constants

This section is empty.

Variables

View Source
var MockSender = NewSender(&Config{From: "kora@localhost"})

MockSender is used when no SMTP config is available. It logs and drops.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host     string
	Port     int
	Username string
	Password string
	From     string
}

Config holds SMTP configuration.

type Message

type Message struct {
	To      []string
	Subject string
	Body    string
	IsHTML  bool
}

Message represents an email message.

type Sender

type Sender struct {
	Config *Config
}

Sender sends emails.

func NewSender

func NewSender(cfg *Config) *Sender

NewSender creates a new email sender.

func (*Sender) Send

func (s *Sender) Send(msg *Message) error

Send sends an email message. In Phase 1, this logs the email instead of actually sending it.

func (*Sender) SendTemplate

func (s *Sender) SendTemplate(to []string, subject, body string, data map[string]string) error

SendTemplate sends an email using template interpolation. Replaces {fieldname} placeholders with values from the data map.

Jump to

Keyboard shortcuts

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