Documentation
¶
Index ¶
- Variables
- func Encode(m Message) ([]byte, error)
- func FormatAddress(name, address string) string
- func FormatAddressList(addresses []netmail.Address) string
- func ParseAddress(value string) (netmail.Address, error)
- func ParseAddressList(values []string) ([]netmail.Address, error)
- type Attachment
- type ConsoleSender
- type Encoder
- type FileSender
- type MemorySender
- type Message
- type SMTPOptions
- type SMTPSender
- type Sender
- type TLSMode
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoSender = errors.New("coyote/mail: the message has no From address") ErrNoRecipient = errors.New("coyote/mail: the message has no recipients") ErrNoBody = errors.New("coyote/mail: the message has neither a text nor an HTML body") ErrBadAddress = errors.New("coyote/mail: unusable address") ErrHeaderInjection = errors.New("coyote/mail: a header value contains a line break") ErrNotConfigured = errors.New("coyote/mail: no email backend is configured") ErrSendFailed = errors.New("coyote/mail: the server refused the message") ErrTooLarge = errors.New("coyote/mail: the message is larger than the limit") )
Functions ¶
func FormatAddress ¶
func FormatAddressList ¶
Types ¶
type Attachment ¶
func FileAttachment ¶
func FileAttachment(path string) (Attachment, error)
func NewAttachment ¶
func NewAttachment(filename, contentType string, content []byte) Attachment
func (Attachment) ContentType ¶
func (a Attachment) ContentType() string
func (Attachment) Name ¶
func (a Attachment) Name() string
func (Attachment) Validate ¶
func (a Attachment) Validate() error
type ConsoleSender ¶
type ConsoleSender struct {
// contains filtered or unexported fields
}
func NewConsole ¶
func NewConsole(w io.Writer) *ConsoleSender
type Encoder ¶
func NewEncoder ¶
func NewEncoder() Encoder
type FileSender ¶
type FileSender struct {
// contains filtered or unexported fields
}
func NewFile ¶
func NewFile(dir string) *FileSender
func (*FileSender) Dir ¶
func (f *FileSender) Dir() string
type MemorySender ¶
type MemorySender struct {
// contains filtered or unexported fields
}
func NewMemory ¶
func NewMemory() *MemorySender
func (*MemorySender) Clear ¶
func (m *MemorySender) Clear()
func (*MemorySender) Count ¶
func (m *MemorySender) Count() int
func (*MemorySender) Last ¶
func (m *MemorySender) Last() (Message, bool)
func (*MemorySender) Raw ¶
func (m *MemorySender) Raw() [][]byte
func (*MemorySender) Sent ¶
func (m *MemorySender) Sent() []Message
type Message ¶
type Message struct {
From string
To []string
CC []string
BCC []string
ReplyTo string
Subject string
Text string
HTML string
Headers map[string]string
Attachments []Attachment
Date time.Time
MessageID string
}
func (Message) Attach ¶
func (m Message) Attach(attachments ...Attachment) Message
func (Message) Recipients ¶
func (Message) WithHeader ¶
type SMTPOptions ¶
type SMTPOptions struct {
Host string
Port int
Username string
Password string
TLS TLSMode
From string
Timeout time.Duration
LocalName string
TLSConfig *tls.Config
}
func (SMTPOptions) Validate ¶
func (o SMTPOptions) Validate() error
type SMTPSender ¶
type SMTPSender struct {
// contains filtered or unexported fields
}
func NewSMTP ¶
func NewSMTP(options SMTPOptions) *SMTPSender
func (*SMTPSender) Addr ¶
func (s *SMTPSender) Addr() string
type Sender ¶
func WithDefaultFrom ¶
Click to show internal directories.
Click to hide internal directories.