gomail

package module
v0.0.0-...-f606a58 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: MIT Imports: 7 Imported by: 0

README

gomail

a simple smtp email sender with golang, support HTML rendering and TLS.

Forked from gomail

Changes:

  • AuthTLS not used if not needed
  • Uses Template string (provided in msg_test.go) instead of separate file.

How To

refer to msg_test.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(addr string) (*smtp.Client, error)

Dial return a smtp client

Types

type SendWorker

type SendWorker struct {
	*Sender
	// contains filtered or unexported fields
}

SendWorker worker process

func (*SendWorker) ParseTemplate

func (sw *SendWorker) ParseTemplate(tmpl string, data interface{}) error

func (*SendWorker) SendEmail

func (sw *SendWorker) SendEmail() error

SendEmail send email

type Sender

type Sender struct {
	User   string
	Passwd string
	Host   string
	Port   int
	// contains filtered or unexported fields
}

Sender global Sender config

func (*Sender) Configure

func (s *Sender) Configure()

Configure make smtp plain auth

func (*Sender) NewSendWorker

func (s *Sender) NewSendWorker(from, to, subject string) *SendWorker

NewSendWorker return a initialized SendWorker struct

Jump to

Keyboard shortcuts

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