smtp

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CRLF = []byte("\r\n")

Functions

This section is empty.

Types

type AddressList

type AddressList []*mail.Address

func (AddressList) List

func (list AddressList) List() []string

func (AddressList) String

func (list AddressList) String() string

type Attachment

type Attachment struct {
	Name        string
	ContentType string
	io.Reader
}

type Mail

type Mail struct {
	Subject     string
	PlainText   []byte
	HTML        []byte
	Attachments []*Attachment
}

func (*Mail) Encode

func (mail *Mail) Encode(from *mail.Address, to AddressList) []byte

TODO: add cc and bcc support

type OTOSendError

type OTOSendError struct {
	Errors []*SendError
}

func (*OTOSendError) Error

func (err *OTOSendError) Error() string

type SMTP

type SMTP struct {
	// contains filtered or unexported fields
}

func New

func New(host string, port uint16, username string, password string) *SMTP

func (*SMTP) Auth

func (s *SMTP) Auth() (err error)

func (*SMTP) SendMail

func (s *SMTP) SendMail(mail *Mail, from string, to string, oneToOne bool) (err error)

type SendError

type SendError struct {
	Message string
	From    *mail.Address
	To      AddressList
}

func (*SendError) Error

func (err *SendError) Error() string

Jump to

Keyboard shortcuts

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