mg

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package mg holds common code shared between the various mailgun commands.

Index

Constants

This section is empty.

Variables

View Source
var (
	IsTTY   bool = isTTY()
	Domain  string
	APIKey  string
	User    string = os.Getenv("USER")
	Verbose bool
)
View Source
var (
	DebugHTTP   bool
	DisableMail bool
)

Functions

func Die

func Die(err error)

func FixLocalAddr

func FixLocalAddr(a *mail.Address)

Allow implicit local domain in addresses.

func FixLocalAddrs

func FixLocalAddrs(list []*mail.Address)

func Init

func Init()

func Logf

func Logf(format string, args ...interface{})

func Mail

func Mail(msg *Message)

func MailMIME

func MailMIME(from *mail.Address, to []*mail.Address, mime io.Reader)

func ParseAddress

func ParseAddress(addr string) (*mail.Address, error)

Types

type AddrListFlag

type AddrListFlag []*mail.Address

func (*AddrListFlag) Set

func (x *AddrListFlag) Set(addr string) error

func (*AddrListFlag) String

func (x *AddrListFlag) String() string

type Message

type Message struct {
	From        *mail.Address
	To          []*mail.Address
	CC          []*mail.Address
	BCC         []*mail.Address
	Subject     string
	Body        string   `json:"-"`
	Attachments []string // file names
}

A Message is a structured mail message to be sent.

type StringListFlag

type StringListFlag []string

func (*StringListFlag) Set

func (x *StringListFlag) Set(s string) error

func (*StringListFlag) String

func (x *StringListFlag) String() string

Jump to

Keyboard shortcuts

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