email

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseHTMLTemplate

func ParseHTMLTemplate(templateFileName string, data interface{}) (body string, err error)

ParseHTMLTemplate is used to parse an html file and include the data on it.

func SendEmail

func SendEmail(e *Email, c *SMTPCredentials) error

SendEmail an email.

Types

type Email

type Email struct {
	// From is the source email.
	FromAddress string

	// FromName is the friendly name of the source.
	FromName string

	// To is a set of destination emails.
	To []string

	// ReplyTo is a set of reply to emails.
	ReplyTo []string

	// Subject is the email subject text.
	Subject string

	// Text is the plain text representation of the body.
	Text string

	// HTML is the HTML representation of the body.
	HTML string
}

Email options.

type SMTPCredentials

type SMTPCredentials struct {
	Host     string
	Port     int
	User     string
	Password string
}

SMTPCredentials is used to hold the smtp credentials.

Jump to

Keyboard shortcuts

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