mailer

package
v2.15.4 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a mailer that sends emails.

func New

func New(cfg Config) *Client

func (*Client) Send

func (m *Client) Send(
	ctx context.Context,
	from string,
	to []string,
	subject, body string,
	attachments []string,
) error

SendMail sends an email.

func (*Client) SendWithRecipients

func (m *Client) SendWithRecipients(
	ctx context.Context,
	from string,
	to []string,
	cc []string,
	bcc []string,
	subject, body string,
	attachments []string,
) error

type Config

type Config struct {
	Host     string
	Port     string
	Username string
	Password string
	Token    func(context.Context) (*oauth2.Token, error)
}

Config is a config for SMTP mailer.

func BuildConfig added in v2.13.0

func BuildConfig(host, port, username, password string, oauthConfig *oauthconfig.Config) (Config, error)

BuildConfig constructs a mailer configuration from resolved SMTP settings.

Directories

Path Synopsis
Package oauthconfig defines SMTP OAuth configuration.
Package oauthconfig defines SMTP OAuth configuration.

Jump to

Keyboard shortcuts

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