Documentation
¶
Overview ¶
Package email provides email sender
Index ¶
- type Logger
- type Option
- func Auth(smtpUserName, smtpPasswd string) Option
- func Charset(charset string) Option
- func ContentType(contentType string) Option
- func Log(l Logger) Option
- func Port(port int) Option
- func SMTP(smtp SMTPClient) Option
- func STARTTLS(enabled bool) Option
- func TLS(enabled bool) Option
- func TimeOut(timeOut time.Duration) Option
- type Params
- type SMTPClient
- type Sender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface {
Logf(format string, args ...interface{})
}
Logger is used to log errors and debug messages
type Option ¶
type Option func(s *Sender)
Option func type
func ContentType ¶
ContentType sets content type of the email
type Params ¶
type Params struct { From string // From email field To []string // From email field Subject string // Email subject UnsubscribeLink string // POST, https://support.google.com/mail/answer/81126 -> "Use one-click unsubscribe" InReplyTo string // Identifier for email group (category), used for email grouping Attachments []string // Attachments path InlineImages []string // InlineImages images path }
Params contains all user-defined parameters to send emails
type SMTPClient ¶
type SMTPClient interface { Mail(from string) error Auth(auth smtp.Auth) error Rcpt(to string) error Data() (io.WriteCloser, error) Quit() error Close() error }
SMTPClient interface defines subset of net/smtp used by email client
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender implements email sender
Click to show internal directories.
Click to hide internal directories.