smtp

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ConnectTimeout = 5 * time.Second

ConnectTimeout is the maximum time allowed for establishing SMTP TCP connections.

Variables

This section is empty.

Functions

func DialClient added in v0.2.0

func DialClient(addr, host string) (*smtp.Client, error)

DialClient connects to an SMTP server with an explicit timeout and returns a client that can be upgraded with STARTTLS.

Types

type Client

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

func NewClient

func NewClient(cfg *config.Config, password string) *Client

func (*Client) Send

func (c *Client) Send(msg *Message) error

type Message

type Message struct {
	From        string
	To          []string
	CC          []string
	BCC         []string
	Subject     string
	Body        string
	Attachments []string
	InReplyTo   string
	References  string
}

Jump to

Keyboard shortcuts

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