Versions in this module Expand all Collapse all v0 v0.0.2 Apr 9, 2023 v0.0.1 Apr 9, 2023 Changes in this version + var EnhancedCodeNotSet = EnhancedCode + var ErrAuthRequired = &SMTPError + var ErrAuthUnsupported = &SMTPError + var ErrDataReset = errors.New("smtp: message transmission aborted") + var ErrDataTooLarge = &SMTPError + var ErrTooLongLine = errors.New("smtp: too long a line in input stream") + var NoEnhancedCode = EnhancedCode + func SendMail(addr string, a sasl.Client, from string, to []string, r io.Reader) error + func SendMailTLS(addr string, a sasl.Client, from string, to []string, r io.Reader) error + type Backend interface + NewSession func(c *Conn) (Session, error) + type BodyType string + const Body7Bit + const Body8BitMIME + const BodyBinaryMIME + type Client struct + CommandTimeout time.Duration + DebugWriter io.Writer + SubmissionTimeout time.Duration + Text *textproto.Conn + func Dial(addr string) (*Client, error) + func DialTLS(addr string, tlsConfig *tls.Config) (*Client, error) + func NewClient(conn net.Conn, host string) (*Client, error) + func NewClientLMTP(conn net.Conn, host string) (*Client, error) + func (c *Client) Auth(a sasl.Client) error + func (c *Client) Close() error + func (c *Client) Data() (io.WriteCloser, error) + func (c *Client) Extension(ext string) (bool, string) + func (c *Client) Hello(localName string) error + func (c *Client) LMTPData(statusCb func(rcpt string, status *SMTPError)) (io.WriteCloser, error) + func (c *Client) Mail(from string, opts *MailOptions) error + func (c *Client) Noop() error + func (c *Client) Quit() error + func (c *Client) Rcpt(to string) error + func (c *Client) Reset() error + func (c *Client) SendMail(from string, to []string, r io.Reader) error + func (c *Client) StartTLS(config *tls.Config) error + func (c *Client) TLSConnectionState() (state tls.ConnectionState, ok bool) + func (c *Client) Verify(addr string) error + type Conn struct + func (c *Conn) Close() error + func (c *Conn) Conn() net.Conn + func (c *Conn) Hostname() string + func (c *Conn) Reject() + func (c *Conn) Server() *Server + func (c *Conn) Session() Session + func (c *Conn) TLSConnectionState() (state tls.ConnectionState, ok bool) + type EnhancedCode [3]int + type LMTPSession interface + LMTPData func(r io.Reader, status StatusCollector) error + type Logger interface + Printf func(format string, v ...interface{}) + Println func(v ...interface{}) + type MailOptions struct + Auth *string + Body BodyType + RequireTLS bool + Size int + UTF8 bool + type SMTPError struct + Code int + EnhancedCode EnhancedCode + Message string + func (err *SMTPError) Error() string + func (err *SMTPError) Temporary() bool + type SaslServerFactory func(conn *Conn) sasl.Server + type Server struct + Addr string + AllowInsecureAuth bool + AuthDisabled bool + Backend Backend + Debug io.Writer + Domain string + EnableBINARYMIME bool + EnableREQUIRETLS bool + EnableSMTPUTF8 bool + ErrorLog Logger + LMTP bool + MaxLineLength int + MaxMessageBytes int + MaxRecipients int + ReadTimeout time.Duration + Strict bool + TLSConfig *tls.Config + WriteTimeout time.Duration + func NewServer(be Backend) *Server + func (s *Server) Close() error + func (s *Server) EnableAuth(name string, f SaslServerFactory) + func (s *Server) ForEachConn(f func(*Conn)) + func (s *Server) ListenAndServe() error + func (s *Server) ListenAndServeTLS() error + func (s *Server) Serve(l net.Listener) error + type Session interface + AuthPlain func(username, password string) error + Data func(r io.Reader) error + Logout func() error + Mail func(from string, opts *MailOptions) error + Rcpt func(to string) error + Reset func() + type StatusCollector interface + SetStatus func(rcptTo string, err error)