smtp

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(rt *runner.Runtime, sender Sender)

Register installs the standard library and binds mail() to sender.

Types

type Config

type Config struct {
	Host     string `yaml:"host" json:"host"`
	Port     int    `yaml:"port" json:"port"`
	Username string `yaml:"username" json:"username"`
	Password string `yaml:"password" json:"password"`
	From     string `yaml:"from" json:"from"`
}

Config contains the connection and sender settings for SMTP.

type SMTP

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

SMTP implements the Sender interface using SMTP

func NewSMTP

func NewSMTP(config Config) *SMTP

NewSMTP creates a new SMTP client

func (*SMTP) Send

func (s *SMTP) Send(recipient, subject, body string) error

Send sends an email via SMTP

type Sender

type Sender interface {
	Send(recipient, subject, body string) error
}

Sender interface defines methods for sending emails

Jump to

Keyboard shortcuts

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