email

package module
v0.0.0-...-0ee285c Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2017 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

email

Email package for Go (golang)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Email

type Email struct {

	//Raw     []byte
	Headers Header

	// todo slice -> map
	Parts []multipart.Part

	ContentType       string
	ContentTypeParams map[string]string
	IsMultipart       bool
	// contains filtered or unexported fields
}

Email represents an email

func NewFromByte

func NewFromByte(messageBytes []byte) (m Email, err error)

NewFromByte returns email from []byte

func NewFromFile

func NewFromFile(path string) (m Email, err error)

NewFromFile returns email from file

func NewFromString

func NewFromString(messageStr string) (m Email, err error)

NewFromString retuns email from a string

func (*Email) Close

func (m *Email) Close() error

Close is an explicit finalizer it close Email.reader and remove temporary files

func (*Email) GetDomains

func (m *Email) GetDomains() (domains map[string]int, err error)

GetDomains returns un slice of domains names found in email src

func (*Email) GetHeader

func (m *Email) GetHeader(key string) (string, error)

GetHeader returns first value for header key key

func (*Email) GetHeaders

func (m *Email) GetHeaders(key string) (headers []string, err error)

GetHeaders returns valueS for header key key

func (*Email) GetRawBody

func (m *Email) GetRawBody() (body []byte, err error)

GetRawBody returns body as []byte

func (*Email) GetRawHeaders

func (m *Email) GetRawHeaders() ([]byte, error)

GetRawHeaders returns headers as []byte

func (*Email) RawFromFile

func (m *Email) RawFromFile() (raw []byte, err error)

RawFromFile return email as raw []byte

func (*Email) RawFromStruct

func (m *Email) RawFromStruct() (raw []byte, err error)

RawFromStruct return email as raw []byte

type Header map[string][]string

Header represents email headers

Jump to

Keyboard shortcuts

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