Skip to content

mokelab-go/mail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mail

Email related module

How to use

get this library with go get

$ go get github.com/mokelab-go/mail

Create client object and call Send method

client := mailgun.New(apiKey, domain, from)
err := client.Send(to, subject, body)

example

package main

import (
	"fmt"
	"github.com/mokelab-go/mail/mailgun"
)

const (
	apiKey  = "<Input your API Key>"
	domain  = "<Input your domain in mailgun>"
	from    = "<Input from address>"
	to      = "<Input to address>"
	subject = "メールガンから送信"
	body    = "テストコードから本文"
)

func main() {
	client := mailgun.New(apiKey, domain, from)
	err := client.Send(to, subject, body)
	if err != nil {
		fmt.Printf("Unexepcted Error : %s", err)
	}
}

Releases

No releases published

Packages

No packages published

Languages