goemail

package module
v0.0.0-...-fd6049b Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: BSD-2-Clause Imports: 10 Imported by: 0

README

goemail

Email Sending Framework Built Using Golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Send

func Send(addr string, auth smtp.Auth, m *Message) error

Types

type Attachment

type Attachment struct {
	Filename string
	Data     []byte
	Inline   bool
}
type Header struct {
	Key   string
	Value string
}

type Message

type Message struct {
	From            mail.Address
	To              []string
	Cc              []string
	Bcc             []string
	ReplyTo         string
	Subject         string
	Body            string
	BodyContentType string
	Headers         []Header
	Attachments     map[string]*Attachment
}

func NewHTMLMessage

func NewHTMLMessage(subject string, body string) *Message

func NewMessage

func NewMessage(subject string, body string) *Message

func (*Message) AddBcc

func (m *Message) AddBcc(address mail.Address) []string

func (*Message) AddCc

func (m *Message) AddCc(address mail.Address) []string

func (*Message) AddHeader

func (m *Message) AddHeader(key string, value string) Header

func (*Message) AddTo

func (m *Message) AddTo(address mail.Address) []string

func (*Message) Attach

func (m *Message) Attach(file string) error

func (*Message) AttachBuffer

func (m *Message) AttachBuffer(filename string, buf []byte, inline bool) error

func (*Message) Bytes

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

func (*Message) Inline

func (m *Message) Inline(file string) error

func (*Message) Tolist

func (m *Message) Tolist() []string

Jump to

Keyboard shortcuts

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