smtp

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: AGPL-3.0 Imports: 9 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
}

func New

func New(host string, port int, email, password string) *Client

func (*Client) Send

func (c *Client) Send(ctx context.Context, to, subject, body string) (err error)

func (*Client) TestConnection

func (c *Client) TestConnection(ctx context.Context) (err error)

TestConnection dials the SMTP server, upgrades to TLS when offered, and authenticates, without sending any mail, to verify the configured host/port/credentials work. The dial honors ctx cancellation, and — when ctx carries a deadline — the whole handshake (STARTTLS/Auth included) is bounded by it, so a host that never responds fails once ctx expires instead of hanging indefinitely.

Jump to

Keyboard shortcuts

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