Documentation
¶
Index ¶
- Constants
- func OptimisticUID() (string, error)
- func Params() []string
- func Send(data map[string]any, opts ...Option) (map[string]any, error)
- func Serve()
- type Action
- type Bulk
- type Callback
- type Client
- func (c *Client) Auth(a smtp.Auth) 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) Mail(from string) 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) StartTLS(config *tls.Config) error
- func (c *Client) TLSConnectionState() (state tls.ConnectionState, ok bool)
- func (c *Client) Verify(addr string) error
- type DeliveryResult
- type Mail
- type MockServer
- type MockServerSession
- type Option
- type Req
- type Res
- type Result
- type TLS
Constants ¶
View Source
const ( StartTLSOff = "off" StartTLSAuto = "auto" StartTLSRequired = "required" )
The values of starttls.
Variables ¶
This section is empty.
Functions ¶
func OptimisticUID ¶
Types ¶
type Bulk ¶
type Bulk struct {
Addr string `map:"addr" validate:"required"`
From string `map:"from" validate:"required"`
To string `map:"to" validate:"required"`
Subject string `map:"subject"`
MyHostname string `map:"myhostname"`
Session int `map:"session"`
Message int `map:"message"`
Length int `map:"length"`
// StartTLS is off, auto or required, as the smtp action's starttls. It
// is off when empty, as Bulk always was.
StartTLS string
// InsecureSkipTLS accepts any certificate after STARTTLS.
InsecureSkipTLS bool
// contains filtered or unexported fields
}
func (*Bulk) DeliverWithResult ¶
func (b *Bulk) DeliverWithResult() DeliveryResult
type Client ¶
func (*Client) TLSConnectionState ¶
func (c *Client) TLSConnectionState() (state tls.ConnectionState, ok bool)
type DeliveryResult ¶
type Mail ¶
type Mail struct {
Addr string
// LocalName is the host name sent in EHLO and HELO. When it is empty the
// machine's host name is used, falling back to "localhost".
LocalName string
MailFrom string
RcptTo []string
Data []byte
Auth smtp.Auth
StartTLSDisabled bool
// StartTLSRequired fails the session when the server does not offer
// STARTTLS, instead of going on in plain text.
StartTLSRequired bool
// InsecureSkipVerify accepts any certificate after STARTTLS, such as a
// self-signed one.
InsecureSkipVerify bool
MessageCount int
// Delivered is how many messages the server accepted in the last Send.
// Each message is committed on its own, so a Send that fails part way
// has still delivered the ones before.
Delivered int
}
type MockServer ¶
type MockServer struct {
Addr string
Name string
Log *log.Logger
*TLS
// contains filtered or unexported fields
}
func (*MockServer) Serve ¶
func (s *MockServer) Serve() error
type MockServerSession ¶
type MockServerSession struct {
// contains filtered or unexported fields
}
type Req ¶
type Req struct {
Addr string `map:"addr" validate:"required"`
From string `map:"from" validate:"required"`
To string `map:"to" validate:"required"`
Subject string `map:"subject"`
MyHostname string `map:"myhostname"`
Session int `map:"session"`
Message int `map:"message"`
Length int `map:"length"`
// StartTLS is off, auto (use it when the server offers it) or required
// (fail when it does not).
StartTLS string `map:"starttls"`
InsecureSkipTLS bool `map:"insecure_skip_tls"`
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.