Documentation
¶
Overview ¶
Package mailbox is a Go utility library that implements mailing primitives.
Index ¶
- Constants
- func BuildMail(from string, to []string, subject string, textTmpl *texttemplate.Template, ...) ([]byte, error)
- func NewConsoleClient(username string, timeProvider TimeProvider, writer io.Writer) *consoleClient
- func NewInMemMailClient(username string, timeProvider TimeProvider) *inMemMailClient
- func NewSMTPClient(hostname string, port int, username string, password string, ...) *smtpClient
- func ParseMail(msg string) (string, string, error)
- type TimeProvider
Constants ¶
View Source
const ( // ClientTypeSMTP represents mail clients using SMTP protocol to send emails. ClientTypeSMTP = "smtp" // ClientTypeSMTP represents mail clients using console to print emails. ClientTypeConsole = "console" // BoundaryLength represents mail boundary length. BoundaryLength = 32 )
mail client types.
Variables ¶
This section is empty.
Functions ¶
func BuildMail ¶
func BuildMail( from string, to []string, subject string, textTmpl *texttemplate.Template, htmlTmpl *htmltemplate.Template, tmplData any, timeProvider TimeProvider, ) ([]byte, error)
BuildMail builds multi-line email body using MIME format.
func NewConsoleClient ¶
func NewConsoleClient(username string, timeProvider TimeProvider, writer io.Writer) *consoleClient
NewConsoleClient returns a new consoleClient.
func NewInMemMailClient ¶
func NewInMemMailClient(username string, timeProvider TimeProvider) *inMemMailClient
NewInMemMailClient returns a new inMemMailClient.
func NewSMTPClient ¶
func NewSMTPClient( hostname string, port int, username string, password string, timeProvider TimeProvider, ) *smtpClient
NewSMTPClient returns a new smtpClient.
Types ¶
type TimeProvider ¶
TimeProvider represents a component that provides the current timestamp.
Click to show internal directories.
Click to hide internal directories.