alert

package
v0.0.0-...-7c12c5a Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2015 License: GPL-2.0, GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Forked from github.com/SlyMarbo/gmail

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alert

func Alert(message string)

Sends a critical alert message to administrators.

func SendEmail

func SendEmail(subject, body string, tos []string) error

Convenience function

Types

type Email

type Email struct {
	From        string
	To          []string
	Subject     string
	ContentType string
	Body        string
	Attachments map[string][]byte
}

Email represents a single message, which may contain attachments.

func Compose

func Compose(Subject, Body string) *Email

Compose begins a new email, filling the subject and body, and allocating memory for the list of recipients and the attachments.

func (*Email) AddRecipient

func (e *Email) AddRecipient(Recipient string)

AddRecipient adds a single recipient.

func (*Email) AddRecipients

func (e *Email) AddRecipients(Recipients ...string)

AddRecipients adds one or more recipients.

func (*Email) Attach

func (e *Email) Attach(Filename string) error

Attach takes a filename and adds this to the message. Note that since only the filename is stored (and not its path, for privacy reasons), multiple files in different directories but with the same filename and extension cannot be sent.

func (*Email) Bytes

func (e *Email) Bytes() []byte

func (*Email) Send

func (e *Email) Send() error

Send sends the email, returning any error encountered.

Jump to

Keyboard shortcuts

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