Documentation
¶
Overview ¶
Package mailer is a simple e-mail sender.
Index ¶
Constants ¶
View Source
const (
// Version is the current version number of mailer
Version = "0.0.2"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Host is the server mail host, IP or address
Host string
// Port is the listening port
Port int
// Username is the auth username@domain.com for the sender
Username string
// Password is the auth password for the sender
Password string
// FromAddr is the 'from' part of the mail header, it overrides the username
FromAddr string
// FromAlias is the from part, if empty this is the first part before @ from the Username field
FromAlias string
// UseCommand enable it if you want to send e-mail with the mail command instead of smtp
//
// Host,Port & Password will be ignored
// ONLY FOR UNIX
UseCommand bool
}
Config keeps the configs for mail sender service
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default configs for Mail returns just an empty Mail struct
type Service ¶
type Service interface {
// Send sends a mail to recipients
// the body can be html also
//
// Note: you can change the UseCommand in runtime
Send(string, string, ...string) error
// UpdateConfig replaces the current configuration with the receiver
UpdateConfig(Config)
}
Service is the interface which mail sender(mailer) should implement
Click to show internal directories.
Click to hide internal directories.