api

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatEmailAddress

func FormatEmailAddress(addr string) string

ParseEmailAddress handles email formats like "Name <[email protected]>" or "[email protected]"

func ParseEmailAddress

func ParseEmailAddress(addr string) (string, error)

ParseEmailAddress handles email formats like "Name <[email protected]>" or "[email protected]"

func SendMail

func SendMail(smtpHost string, smtpPort int, username, password, from, to, subject, body string, cc, bcc []string, attachments []string) error

SendMail sends an email using provided parameters

func SendRawEML

func SendRawEML(smtpHost string, smtpPort int, username, password string, emlPath string) error

SendRawEML sends a raw .eml file

Types

type Config

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

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig attempts to load configuration from ~/.config/mailer/config.json

func LoadConfigFromPath

func LoadConfigFromPath(configPath string) (*Config, error)

LoadConfigFromPath loads configuration from a specific path

Jump to

Keyboard shortcuts

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