smtp

package
v0.0.0-...-4400219 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(w io.Writer, headers Headers, tmpl *template.Template, data any) error

Types

type Config

type Config struct {
	Host      string `env:"HOST"`
	Port      string `env:"PORT"`
	Username  string `env:"USERNAME"`
	Password  string `env:"PASSWORD"`
	Name      string `yaml:"name"`
	From      string `yaml:"from"`
	ErrorLog  *log.Logger
	TLSConfig *tls.Config
}

type Headers

type Headers struct {
	From string
	To   string
	Date time.Time
}

type Service

type Service interface {
	Ping() error
	Send(to string, tmpl *template.Template, data any)
	Close()
}

func NewService

func NewService(cfg *Config) Service

Jump to

Keyboard shortcuts

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