Documentation
¶
Overview ¶
Package email provides the interface and implementations for sending email.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct {
From string
To []string
Subject string
// Body is the HTML body of the email.
Body string
}
Message represents an outbound email message.
type NoopSender ¶
type NoopSender struct{}
NoopSender discards all messages. Use in tests or when email is disabled.
type SMTPSender ¶
type SMTPSender struct {
// contains filtered or unexported fields
}
SMTPSender delivers email via SMTP. For local development, use mailhog (no auth, no TLS required).
func NewSMTPSender ¶
func NewSMTPSender(host string, port int, from string) *SMTPSender
NewSMTPSender creates an SMTPSender that connects to the given host and port. The from address is used when the Message.From field is empty.
Click to show internal directories.
Click to hide internal directories.