mail

package
v0.0.0-...-ee64d59 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

The Backend implements SMTP server methods.

func NewBackend

func NewBackend(user, pass string) *Backend

func (*Backend) AddHook

func (b *Backend) AddHook(hook Hook)

func (*Backend) NewSession

func (bkd *Backend) NewSession(c *smtp.Conn) (smtp.Session, error)

NewSession is called after client greeting (EHLO, HELO).

type Hook

type Hook struct {
	Address      string `yaml:"address"`
	Name         string `yaml:"name"`
	URL          string `yaml:"url"`
	HTMLMarkdown bool   `yaml:"html_markdown"`
}

func NewHook

func NewHook(emailAddress, name, hookURL string) *Hook

func (Hook) Send

func (h Hook) Send(from, text string) error

type Session

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

A Session is returned after successful login.

func (Session) AuthPlain

func (s Session) AuthPlain(username, password string) error

AuthPlain implements authentication using SASL PLAIN.

func (*Session) Data

func (s *Session) Data(r io.Reader) error

func (*Session) Logout

func (s *Session) Logout() error

func (*Session) Mail

func (s *Session) Mail(from string, opts *smtp.MailOptions) error

func (*Session) Rcpt

func (s *Session) Rcpt(to string, opts *smtp.RcptOptions) error

func (*Session) Reset

func (s *Session) Reset()

Jump to

Keyboard shortcuts

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