mail

package module
v0.0.0-...-c7c5957 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2018 License: MIT Imports: 22 Imported by: 2

Documentation

Index

Constants

View Source
const TIME_FORMAT = time.RFC1123Z

Variables

This section is empty.

Functions

func SmtpNTLMAuthenticate

func SmtpNTLMAuthenticate(c *smtp.Client, a *NTLMAuth) error

Copy-paste from smtp.Client.Auth for minor modified

Types

type Attachment

type Attachment struct {
	Filename string
	Data     []byte
	Inline   bool
}
type Header textproto.MIMEHeader

func (Header) Bytes

func (h Header) Bytes() []byte

func (Header) MIMEHeader

func (h Header) MIMEHeader() textproto.MIMEHeader

func (Header) SetAddress

func (h Header) SetAddress(key string, value ...string) error

func (Header) SetDate

func (h Header) SetDate(key string, value time.Time)

func (Header) SetString

func (h Header) SetString(key string, value string)

func (Header) SetValue

func (h Header) SetValue(key, value string, params HeaderParams)

type HeaderParams

type HeaderParams map[string]interface{}

type Message

type Message struct {
	To              string
	Cc              []string
	Bcc             []string
	ReplyTo         string
	Subject         string
	Body            string
	BodyContentType string // TODO remove, because don't use in the library
	Attachments     map[string]*Attachment
	// contains filtered or unexported fields
}

func NewMessage

func NewMessage(smtpClient *SmtpClient, to string, subject string, body string) *Message

func (*Message) Attach

func (m *Message) Attach(file string, inline bool) error

func (*Message) SendMail

func (m *Message) SendMail() error

type NTLMAuth

type NTLMAuth struct {
	mssql.NTLMAuth
	Host string
}

NTLMAuth implements smtp.Auth. The authentication mechanism.

func NewNTLMAuth

func NewNTLMAuth(host, user, password, workstation string) (*NTLMAuth, error)

func (*NTLMAuth) Next

func (n *NTLMAuth) Next(fromServer []byte, more bool) ([]byte, error)

func (*NTLMAuth) Start

func (n *NTLMAuth) Start(server *smtp.ServerInfo) (string, []byte, error)

type SmtpClient

type SmtpClient struct {
	io.Closer

	Host        string
	Port        string
	User        string
	Password    string
	Workstation string // NTLM authentication mechanism
	From        string
	MaxLifetime time.Duration
	TLSConfig   *tls.Config
	// contains filtered or unexported fields
}

func (*SmtpClient) Close

func (c *SmtpClient) Close() error

func (*SmtpClient) Connection

func (c *SmtpClient) Connection() (*smtp.Client, error)

Jump to

Keyboard shortcuts

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