Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoSMTPClient = errors.New("no SMTP client provided") // no SMTP client provided ErrAuthFailed = errors.New("authentication failed") // authentication failed ErrComposeEmail = errors.New("failed to compose email") // failed to compose email ErrNoBytesWritten = errors.New("no bytes written") // no bytes written )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the simplified SMTP client used for sending notification emails.
func (*Client) Authenticate ¶
Authenticate initiates the SMTP handshake and authenticates the client.
type Option ¶
Option is a function that configures a Client.
func WithConfig ¶
func WithConfig(cfg *config.SMTPConfig) Option
WithConfig returns an Option that configures a Client with the given configuration.
func WithLogger ¶
WithLogger returns an Option that configures a Client with the given logger.
func WithTracer ¶
WithTracer returns an Option that configures a Client with the given tracer.
func WithWrappedClient ¶
func WithWrappedClient(wrapped WrappedClient) Option
WithWrappedClient returns an Option that configures a Client with the given wrapped SMTP client. The given SMTP client is used as a base that is configured.
type WrappedClient ¶
type WrappedClient interface { Close() error Hello(localName string) error StartTLS(config *tls.Config) error TLSConnectionState() (state tls.ConnectionState, ok bool) Verify(addr string) error Auth(a smtp.Auth) error Mail(from string) error Rcpt(to string) error Data() (io.WriteCloser, error) Extension(ext string) (bool, string) Reset() error Noop() error Quit() error }
WrappedClient is the interface that wraps the SMTP client methods used by the Client.