mail

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled  bool     `json:"enabled"`
	From     []string `json:"from"`
	Host     string   `json:"host"`
	Port     int      `json:"port"`
	Username string   `json:"username"`
	Password string   `json:"password"`
	TmpDir   string   `json:"tmpDir"`
}

func (*Config) NewMail

func (p *Config) NewMail(tpl Executer, input interface{}) (*MailContext, error)

func (Config) String

func (p Config) String() string

func (*Config) Validate

func (p *Config) Validate() error

type Executer

type Executer interface {
	Execute(wr io.Writer, data interface{}) error
}

type MailContext

type MailContext struct {
	*Config
	Dialer  *gomail.Dialer
	Message *gomail.Message
	// contains filtered or unexported fields
}

func (*MailContext) DialAndSend

func (p *MailContext) DialAndSend() error

func (*MailContext) EmbedBuffer

func (p *MailContext) EmbedBuffer(name string, body []byte) error

func (*MailContext) SetHeader

func (p *MailContext) SetHeader(field string, value ...string)

Jump to

Keyboard shortcuts

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