email

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2015 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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.

Types

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"`
	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.

Jump to

Keyboard shortcuts

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