Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
Register binds mail() to sender. The standard library itself is registered separately by the embedding host (stdlib.Register).
func RegisterSMTP ¶ added in v0.2.4
RegisterSMTP installs the SMTP class binding, so `new SMTP` in a script constructs a script-configured sender.
func SenderContext ¶ added in v0.2.4
SenderContext binds a Sender into the context. A runtime running with that context constructs `new SMTP` clients that hand their messages to the sender rather than dialing the configured host, which is how a host captures mail (see Memory) without a mail server.
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"`
// Insecure accepts the STARTTLS certificate without verifying its chain or
// names. Hosts that present a self-signed certificate, or one carrying no
// subjectAltName, are unreachable without it.
Insecure bool `yaml:"insecure" json:"insecure"`
}
Config contains the connection and sender settings for SMTP.
type Memory ¶ added in v0.2.4
type Memory struct {
// contains filtered or unexported fields
}
Memory is a Sender that appends messages to an in-memory queue instead of delivering them. Hosts bind one with SenderContext to capture what scripts send (tests, local runs, dry runs).
func NewMemory ¶ added in v0.2.4
func NewMemory() *Memory
NewMemory creates an empty in-memory sender.
type SMTP ¶
type SMTP struct {
// contains filtered or unexported fields
}
SMTP implements the Sender interface using SMTP
func NewSMTPBinding ¶ added in v0.2.4
NewSMTPBinding is a mail sender configured for one SMTP server. It takes the connection settings as an associative array:
$smtp = new SMTP(array( "host" => "mail.example.com", "port" => 587, "username" => "noreply@example.com", "password" => "secret", "from" => "Example <noreply@example.com>", "insecure" => true, ));