mail

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: ISC Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.

func UseLogger

func UseLogger(logger slog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using slog.

Types

type Client

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

Client provides an SMTP client for sending emails from a preset email address.

func New

func New(host, user, password, emailAddress, certPath string, skipVerify bool) (*Client, error)

New returns a new mail Client.

func (*Client) IsEnabled

func (c *Client) IsEnabled() bool

IsEnabled returns whether the mail server is enabled.

func (*Client) SendTo

func (c *Client) SendTo(subject, body string, recipients []string) error

SendTo sends an email with the given subject and body to the provided list of email addresses.

Jump to

Keyboard shortcuts

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