smtp

package
v0.0.0-...-717446a Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 2 Imported by: 1

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
}

Smtp Client handle, used for triggering sending messages

func New

func New(config Config) *Client

Create a new Client handle for the given config

func (*Client) Send

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

type Config

type Config struct {
	// smtp server host which is providing the mail services
	// typically gmail smtp would be "smtp.gmail.com"
	Host string

	// port over which the smtp service is provided
	Port string

	// Sender email address / username for authentication
	Sender string

	// Sender Descriptive Name to be included in the email
	SenderName string

	// reply-to email address as typically sender email would
	// be device control and typically would be no-reply,
	// if empty means reply-to is not configured
	ReplyTo string

	// Password for authenticating the sender with smtp server
	Password string
}

Base Configuration with which an smtp client will be created.

type Message

type Message struct {
	// List of Receivers to whom this message is being sent
	Receivers []string

	// Subject of the message to be sent
	Subject string

	// Body of the email message to be sent
	Body string

	// if this is an HTML message
	Html bool
}

Smtp message structure

Jump to

Keyboard shortcuts

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