email

package
v0.0.0-...-ed4c6ac Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 13 Imported by: 10

Documentation

Overview

Package email provides email sending functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Email

type Email struct {
	Name    string
	Address string
}

Email struct holds email address and recipient name.

func NewEmail

func NewEmail(name string, address string) Email

NewEmail returns an email address.

type Mailer

type Mailer interface {
	Send(Message) error
}

func NewMailer

func NewMailer() (Mailer, error)

NewMailer returns a configured SMTP Mailer.

type Message

type Message struct {
	From     Email
	To       Email
	Subject  string
	Template string
	Content  any
	// contains filtered or unexported fields
}

Message struct holds all parts of a specific email Message.

type MockMailer

type MockMailer struct {
	SendFn      func(m Message) error
	SendInvoked bool
}

MockMailer is a mock Mailer

func NewMockMailer

func NewMockMailer() *MockMailer

func (*MockMailer) Send

func (s *MockMailer) Send(m Message) error

type SMTPMailer

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

SMTPMailer is a SMTP mailer.

func (*SMTPMailer) Send

func (m *SMTPMailer) Send(email Message) error

Send sends the mail via smtp.

Jump to

Keyboard shortcuts

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