gomail

package module
v0.0.0-...-80ad6d3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: GPL-2.0 Imports: 11 Imported by: 0

README

gomail

Simple package for sending emails with Go.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Email

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

func New

func New(server string, from, to string, subject string) (*Email, error)

New constructs a new Email for sending.

func NewWithAuth

func NewWithAuth(server string, tlsConfig *tls.Config, auth smtp.Auth, from, to string, subject string) (*Email, error)

NewWithAuth constructs a server with optional TLS and Auth

func (*Email) Html

func (e *Email) Html(html string) *Email

Html sets the HTML content of the email. You CANNOT call Html twice - it will panic.

func (*Email) InlineFile

func (e *Email) InlineFile(filename string) (*Email, error)

InlineFile takes the provided file and inlines it into the email. You MUST call Html(..) first, or you will get a panic.

func (*Email) Send

func (e *Email) Send() error

Send sends the emial, returning an error if one occurs.

func (*Email) Text

func (e *Email) Text(text string)

Text sets the text content of the email.

Jump to

Keyboard shortcuts

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