mailer

package
Version: v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CharSet The character encoding for the email.
	CharSet = "UTF-8"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host     string
	Port     string
	Username string
	Password string
	Driver   string
}

Config for mailer

type Mail

type Mail interface {
	From(string, string) Mail
	To(...string) Mail
	Cc(...string) Mail
	Subject(string) Mail
	Body(string) Mail
	Send() (interface{}, error)
}

Mail for smtp or ses interface

var Client Mail

Client for mail interface

func NewEngine

func NewEngine(c Config) (mail Mail, err error)

NewEngine return storage interface

type SES

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

SES for aws ses

func SESEngine

func SESEngine() (*SES, error)

SESEngine initial ses

func (SES) Body

func (c SES) Body(body string) Mail

Body for email body

func (SES) Cc

func (c SES) Cc(address ...string) Mail

Cc for cc list

func (SES) From

func (c SES) From(name, address string) Mail

From for sender information

func (SES) Send

func (c SES) Send() (interface{}, error)

Send email

func (SES) Subject

func (c SES) Subject(subject string) Mail

Subject for email title

func (SES) To

func (c SES) To(address ...string) Mail

To for mailto list

type SMTP

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

SMTP setting

func SMTPEngine

func SMTPEngine(host, port, username, password string) (*SMTP, error)

SMTPEngine initial smtp object

func (SMTP) Body

func (c SMTP) Body(body string) Mail

Body for email body

func (SMTP) Cc

func (c SMTP) Cc(address ...string) Mail

Cc for cc list

func (SMTP) From

func (c SMTP) From(name, address string) Mail

From for sender information

func (SMTP) Send

func (c SMTP) Send() (interface{}, error)

Send email

func (SMTP) Subject

func (c SMTP) Subject(subject string) Mail

Subject for email title

func (SMTP) To

func (c SMTP) To(address ...string) Mail

To for mailto list

Jump to

Keyboard shortcuts

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