smtp

package
v0.0.0-...-52f3ec1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendTestEmail

func SendTestEmail(config SMTPConfig, recipient string) bool

SendTestEmail sends a test email to the specified recipient using the given SMTP configuration. Logs the full process and returns true if successful, false otherwise.

func ValidateSMTPConfig

func ValidateSMTPConfig(config SMTPConfig) error

Validate SMTPConfig connects to the SMTP server and authenticates using the provided credentials. Uses TLS for port 465 and STARTTLS for port 587.

Types

type SMTPConfig

type SMTPConfig struct {
	Host string `json:"host"`
	Port int    `json:"port"`
	User string `json:"user"`
	Pass string `json:"pass"`
}

func LoadJSON

func LoadJSON(path string) ([]SMTPConfig, error)

LoadJSON reads and parses the JSON file into a slice of SMTPConfig

Jump to

Keyboard shortcuts

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