Documentation ¶
Index ¶
- Constants
- Variables
- func Close[T string | interface{}](backendOrName T) error
- func PlainAuth(identity, username, password, host string) smtp.Auth
- func Register(name string, backend EmailBackend)
- func Send(e *email.Email, backendOrName ...interface{}) error
- func SetDefault(backend EmailBackend)
- func Unregister(name string)
- func XOAuth2Auth(username, token string) smtp.Auth
- type Config
- type EmailBackend
- type OpenableEmailBackend
Constants ¶
View Source
const (
DefaultBackend = "default"
)
Variables ¶
View Source
var ( ErrConfigNil = errors.New("config is nil") ErrBackendNotFound = errors.New("backend not found") )
Functions ¶
func Register ¶
func Register(name string, backend EmailBackend)
func SetDefault ¶
func SetDefault(backend EmailBackend)
func Unregister ¶
func Unregister(name string)
func XOAuth2Auth ¶
Types ¶
type Config ¶
type Config struct { Host string // Mail server host. Port int // Mail server port. Username string // Mail server username. Password string // Mail server password. UseTLS bool // USE_TLS UseSSL bool // USE_SSL MailFrom string // Mail server from address. Timeout time.Duration // Timeout duration for sending email. TLSConfig *tls.Config // TLS Config DefaultAuth smtp.Auth // Default SMTP Auth }
type EmailBackend ¶
func Default ¶
func Default() EmailBackend
func Get ¶
func Get(name string) EmailBackend
func NewConsoleBackend ¶
func NewConsoleBackend(f io.Writer) EmailBackend
func NewPooledEmailBackend ¶
func NewPooledEmailBackend(poolCount int, cnf *Config) (EmailBackend, error)
type OpenableEmailBackend ¶
Click to show internal directories.
Click to hide internal directories.