Skip to content

apvinit/emailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Emailer

A pretty wrapper around go net/smtp send multiple email using single client

func main() {
  var client *emailer.Client
  client, err := emailer.NewClient(Options{
		Host: "smtp-test.example.com",
		Port: "1025",
		User: "username",
		Pass: "password",
		Name: "Example User",
		From: "user@example.com",
	})
	if err != nil {
		log.Fatal("Could not initialize client Emailer")
	}

 	var buf bytes.Buffer
	buf.WriteString("Test message content")

	mail := emailer.Mail{
		To:      []string{"test@user.com"},
		Subject: "Test subject",
		Body:    buf,
	}
	mail.SendWith(client)
}

About

Pretty wrapper for sending email using golang `net/smtp`

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages