bigmail

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

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

Go to latest
Published: Sep 3, 2015 License: GPL-2.0 Imports: 9 Imported by: 0

README

bigmail

A Golang project demonstrating concurrent programming by writing a simple mass email sender.

To use:

  • Compile the Cli by running go get github.com/dndx/bigmail and go build -o bigmail github.com/dndx/bigmail/main. This will generate bigmail at your current working directory.
  • ./bigmail to see usages

bigmail contains a sender library and could be integrated into existing project easily.

Benchmark

bigmail sends email very efficiently thanks to the concurrent model offered by Golang.

To Do

  • Better documentation

License

GPL v2, see LICENSE for more details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wait

func Wait()

Blocks until all workers quit

Types

type Message

type Message struct {
	From string
	To   []string
	Body []byte
}

A Message represents an email message that needs to be sent Bigmail will automatically add appropriate envelope headers to make the message valid before sending

type Sender

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

func NewSender

func NewSender(addr string, incoming <-chan *Message, errors chan<- *Message, useTls bool, interval time.Duration) (*Sender, error)

Creates a new sender, it will connect to the remote server and start the goroutine that does the actual sending operation.

addr specifies the address of the SMTP server that the worker will connects to, as specified in smtp/Dial's document. incoming specifies the channel the sender will obtain jobs from. interval specifies the time sender sleeps between sending each message. 0 means no waiting.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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