Version: v0.3.2 Latest Latest

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

Go to latest
Published: Aug 22, 2019 License: MIT Imports: 14 Imported by: 6




This section is empty.


This section is empty.


func GroupAddressesByHost added in v0.3.0

func GroupAddressesByHost(addrs []string) (map[string][]string, error)

Group a list of email addresses by their host. An error will be returned if any of the addresses are invalid.


type Attachment added in v0.2.0

type Attachment struct {
	Filename    string `json:"filename"`
	ContentType string `json:"content_type"`
	Content     string `json:"content"`
	Encoded     bool   `json:"encoded"`

Email attachment. The content of the attachment is provided either as a UTF-8 string or as a Base64-encoded string ("encoded" set to "true").

func (Attachment) Write added in v0.2.0

func (a Attachment) Write(w *multipart.Writer) error

Write the attachment to the specified multipart writer.

type Email

type Email struct {
	From        string       `json:"from"`
	To          []string     `json:"to"`
	Cc          []string     `json:"cc"`
	Bcc         []string     `json:"bcc"`
	Subject     string       `json:"subject"`
	Headers     Headers      `json:"headers"`
	Text        string       `json:"text"`
	Html        string       `json:"html"`
	Attachments []Attachment `json:"attachments"`

Abstract representation of an email.

func (*Email) Messages added in v0.2.0

func (e *Email) Messages(s *queue.Storage) ([]*queue.Message, error)

Convert the email into an array of messages grouped by host suitable for delivery to the mail queue.

type Headers added in v0.3.0

type Headers map[string]string

Map of email headers.

func (Headers) Write added in v0.3.0

func (e Headers) Write(w io.Writer) error

Write the headers to the specified io.Writer. RFC 2047 provides details on how non-ASCII characters should be encoded.

type Raw added in v0.3.2

type Raw struct {
	From string   `json:"from"`
	To   []string `json:"to"`
	Body string   `json:"body"`

Raw represents a raw email message ready for delivery.

func (*Raw) DeliverToQueue added in v0.3.2

func (r *Raw) DeliverToQueue(q *queue.Queue) error

DeliverToQueue delivers raw messages to the queue.

Jump to

Keyboard shortcuts

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