Skip to content

icattlecoder/dout

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dout

=====

attempt to directly send emails, instead of deploying an smtp server.
download:

go get -u github.com/dtynn/dout

example:

package main

import (
	"strings"

	"github.com/dtynn/dout"
	"github.com/qiniu/log"
)

func main() {
	tos := []string{"a@a.com", "a@b.com", "b@a.com", "c@c.com"}
	lines := []string{
		"From: noreply@example.com",
		"To: a@a.com",
		"To: a@b.com",
		"To: b@a.com",
		"To: c@c.com",
		"Subject: for example",
		"\r\n",
		"This is body",
	}
	body := strings.Join(lines, "\r\n")

	hostname := "example.com"
	from := "noreply@example.com"
	d, err := dout.NewWithMemory(hostname, from, log.Std)
	if err != nil {
		log.Fatal(err)
	}

	d.SendMultiWithDefault(tos, []byte(body))
}

About

smtp sender

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%