smtp

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: MIT Imports: 8 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 {
	SMTP struct {
		Host     string `long:"host" env:"HOST" description:"smtp host value"`
		Port     string `long:"port" env:"PORT" description:"smtp port value"`
		Name     string `long:"name" env:"NAME" description:"smtp name value"`
		Email    string `long:"email" env:"EMAIL" description:"smtp email value"`
		Login    string `long:"login" env:"LOGIN" description:"smtp login value"`
		Password string `long:"password" env:"PASSWORD" description:"smtp password value"`
	} `group:"smtp" namespace:"smtp" env-namespace:"SMTP"`
}

func (Config) NewSMTP

func (c Config) NewSMTP() *SMTP

New - возвращает новый SMTP клиент

type SMTP

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

SMTP - структура для отправки писем.

func New

func New(host, port, name, email, login, password string) *SMTP

New - конструктор для создания SMTP с настроенными параметрами.

func (*SMTP) HTML

func (s *SMTP) HTML(name, email, subject string, message []byte) error

Метод отправляет HTML письмо указанному адресату.

func (*SMTP) Text

func (s *SMTP) Text(name, email, subject, message string) error

Метод отправляет текстовое письмо указанному адресату.

Jump to

Keyboard shortcuts

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