email

package
v0.0.0-...-f97ce34 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Delimiter = "**=myohmy689407924327"

	TypeHtml  = "text/html"
	TypePlain = "text/plain"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(cfg *config.Email, logger *zap.Logger) *Client

func (*Client) Send

func (c *Client) Send(msg Messager) error

type Mailer

type Mailer interface {
	Send(msg Messager) error
}

type Message

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

func NewMessage

func NewMessage() *Message

func (*Message) Attach

func (m *Message) Attach(src bytes.Buffer, fileName string)

func (*Message) Bytes

func (m *Message) Bytes() []byte

func (*Message) GetReceiver

func (m *Message) GetReceiver() string

func (*Message) OpenFile

func (m *Message) OpenFile(path string) error

func (*Message) SetBody

func (m *Message) SetBody(msg bytes.Buffer)

func (*Message) SetFrom

func (m *Message) SetFrom(from string)

func (*Message) SetReceiver

func (m *Message) SetReceiver(rcpt string)

func (*Message) SetSubject

func (m *Message) SetSubject(sub string)

func (*Message) SetType

func (m *Message) SetType(t string)

func (*Message) String

func (m *Message) String() string

func (*Message) Validate

func (m *Message) Validate() error

type Messager

type Messager interface {
	SetFrom(from string)

	SetReceiver(rcpt string)
	GetReceiver() string

	SetType(t string)

	SetSubject(sub string)

	SetBody(msg bytes.Buffer)

	OpenFile(path string) error
	Attach(src bytes.Buffer, fileName string)
	Bytes() []byte

	Validate() error
}

Jump to

Keyboard shortcuts

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