mailer

package
v0.0.0-...-ddc59df Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mailer

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

Define a Mailer struct which contains a mail.Dialer instance (used to connect to a SMTP server) and the sender information for your emails (the name and address you want the email to be from, such as "Alice Smith <alice@example.com>").

func New

func New(host string, port int, username, password, sender string) Mailer

func (Mailer) Send

func (m Mailer) Send(recipient, templateFile string, data interface{}) error

Define a Send() method on the Mailer type. This takes the recipient email address as the first parameter, the name of the file containing the templates, and any dynamic data for the templates as an interface{} parameter.

Jump to

Keyboard shortcuts

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