Skip to content

julianvilas/gmailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gmailer

Build Status

Simple Go library to send emails using AWS SES. In order to send the email you need to setup your AWS credentials as specified in the aws-sdk-go documentation.

It has a function to send simple emails SendEmail and a function to send raw emails SendRaw. The latest is useful for sending emails with attachments.

Examples

Assuming you have credentials configured in your default shared credentials profile (~/.aws/credentials):

func main() {
	sess := session.Must(session.NewSession(&aws.Config{
		Region: aws.String("eu-west-1"),
	}))
	svc := ses.New(sess)

	m := gmailer.New(svc)
	err := m.SendRaw(gmailer.Email{
		Subject:     "A fancy email sent with AWS SES",
		Body:        "Here I'll tell you lovely things.",
		From:        "[email protected]",
		Dest:        []string{"[email protected]"},
	})
	if err != nil {
		log.Panicf("executing sending email:", err)
	}
}

About

Simple Go library to send emails using AWS SES

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages