mailer

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: MIT Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Log    *log.Logger
	Config *Flags
}

App is a package general type

func New

func New(logger *log.Logger, cfg *Flags, options ...func(a *App) error) (*App, error)

New creates mailer object Configuration should be set via functional options

func (App) Send

func (a App) Send(email, name, subject, buf string, files []string) (err error)

Send used to send emails

type Flags

type Flags struct {
	Port     int    `long:"smtp_port"  default:"25"        description:"SMTP server port"`
	Host     string `long:"smtp_host"  default:"localhost" description:"SMTP server host"`
	NoTLS    bool   `long:"smtp_notls" description:"Disable TLS cert checking"`
	Login    string `long:"smtp_login" description:"SMTP sender login"`
	Pass     string `long:"smtp_pass"  description:"SMTP sender password"`
	Copy     string `long:"smtp_copy"  description:"SMTP bcopy address"`
	From     string `long:"smtp_from"  description:"SMTP sender email"`
	FromName string `long:"smtp_fromname"  description:"SMTP sender name"`
}

Flags is a package flags sample in form ready for use with github.com/jessevdk/go-flags

Jump to

Keyboard shortcuts

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