email

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2020 License: BSD-3-Clause Imports: 2 Imported by: 3

README

A very simplified service for Email sending in Go

GoDoc

Installation

Run go get resenje.org/email from command line.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// SMTP server host.
	SMTPHost string
	// SMTP server port.
	SMTPPort int
	// Do not verify SMTP hostname over encrypted connection.
	SMTPSkipVerify bool
	// SMTP identity.
	SMTPIdentity string
	// Username for SMTP server authentication.
	SMTPUsername string
	// Password for SMTP server authentication.
	SMTPPassword string
	// Adressess fot Notify method.
	NotifyAddresses []string
	// From address for Notify method.
	DefaultFrom string
	// Subject prefix for Notify method. It is not space separated from subject value.
	SubjectPrefix string
}

Service provides functionality to send emails over SMTP server.

func (Service) Notify

func (s Service) Notify(subject, body string) error

Notify sends an email message to Service.NotifyAddresses.

func (Service) NotifyWithHeaders

func (s Service) NotifyWithHeaders(subject, body string, headers map[string][]string) error

NotifyWithHeaders sends an email message to Service.NotifyAddresses with additional headers.

func (Service) SendEmail

func (s Service) SendEmail(from string, to []string, subject string, body string) error

SendEmail sends an email message.

func (Service) SendEmailWithHeaders

func (s Service) SendEmailWithHeaders(from string, to []string, subject string, body string, headers map[string][]string) error

SendEmailWithHeaders sends an email message with additional headers.

Jump to

Keyboard shortcuts

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