smtp

package
v0.0.0-...-3760dc4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DKIM

type DKIM struct {
	Selector   string `yaml:"selector"`
	PrivateKey string `yaml:"private_key"`
	Domain     string `yaml:"domain"`
}

type Envelope

type Envelope struct {
	From    mail.Address   `yaml:"from"`
	To      []mail.Address `yaml:"to"`
	Subject string         `yaml:"subject"`
	Body    string         `yaml:"body"`
}

Mail represents an email message.

type SendOptions

type SendOptions struct {
	WithTLS bool
	DKIM    DKIM
	Timeout time.Duration
	Port    string
}

type Server

type Server struct {
	Hostname string   `yaml:"host"`
	Port     string   `yaml:"port"`
	Ports    []string `yaml:"ports"`
	Username string   `yaml:"username"`
	Password string   `yaml:"password"`
}

func (Server) Listen

func (server Server) Listen() error

func (Server) Send

func (s Server) Send(mail Envelope, options SendOptions) error

SendMail sends an email using the provided SMTP server and mail message.

Jump to

Keyboard shortcuts

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