mailkit

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	// Content is the binary content of the attachment to use when a Path
	// is not available.
	Content []byte `json:"content"`

	// Filename that will appear in the email.
	// Make sure you pick the correct extension otherwise preview
	// may not work as expected
	Filename string `json:"filename"`

	// Path where the attachment file is hosted instead of providing the
	// content directly.
	Path string `json:"path"`

	// Content type for the attachment, if not set will be derived from
	// the filename property
	ContentType string `json:"contentType"`
}

Attachment is the public struct used for adding attachments to emails

type Email

type Email struct {
	Name    string
	Address string
}

Email represents an email address. Holds name and address.

type Message

type Message struct {
	From        string            `json:"from"`
	To          []string          `json:"to"`
	Subject     string            `json:"subject"`
	Bcc         []string          `json:"bcc,omitempty"`
	Cc          []string          `json:"cc,omitempty"`
	ReplyTo     string            `json:"reply_to,omitempty"`
	Html        string            `json:"html,omitempty"`
	Text        string            `json:"text,omitempty"`
	Tags        []Tag             `json:"tags,omitempty"`
	Attachments []*Attachment     `json:"attachments,omitempty"`
	Headers     map[string]string `json:"headers,omitempty"`
}

Message represents email message.

type Sender

type Sender interface {
	// Send sends an email message.
	Send(ctx context.Context, message Message) error
}

Sender holds logic of sending an email messages.

type Tag

type Tag struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

Tag is used to define custom metadata for message.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL