mail

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AuthType string `comment:"CRAMMD5,PLAIN"`
	Identity string
	Host     string
	Port     string
	UserName string
	Password string
	From     string
}

func (*Config) AfterInject

func (c *Config) AfterInject()

AfterInject calls Init after config fields are populated.

func (*Config) BeforeInject

func (c *Config) BeforeInject()

BeforeInject is a no-op satisfying the Config interface.

func (*Config) Build

func (c *Config) Build() (smtp.Auth, error)

Build returns an smtp.Auth based on the AuthType field ("PLAIN" or "CRAMMD5"). Returns an error if AuthType is missing or unrecognized.

func (*Config) Init

func (c *Config) Init() *Config

Init is a no-op placeholder for future default initialization.

type Mail

type Mail struct {
	smtp.Auth
	Conf Config
}

func (*Mail) Close

func (m *Mail) Close() error

Close is a no-op; smtp.Auth requires no explicit cleanup.

func (*Mail) Config

func (m *Mail) Config() any

Config returns the embedded Conf as the configuration for injection.

func (*Mail) Init

func (m *Mail) Init() error

Init creates the smtp.Auth and stores it in Mail.

Jump to

Keyboard shortcuts

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