Giter VIP home page Giter VIP logo

go-ses's Introduction

go-ses - send email using Amazon AWS Simple Email Service

xrefs funcs top func library users status

go-ses is an API client library for Amazon AWS Simple Email Service (SES). It is a fork of Patrick Crosby's stathat/amzses.

Note: the public API is experimental and subject to change until further notice.

Usage

Documentation: go-ses on Sourcegraph.

Example: example_test.go (Sourcegraph):

package ses_test

import (
	"fmt"
	"github.com/sourcegraph/go-ses"
)

func Example() {
	// Change the From address to a sender address that is verified in your Amazon SES account.
	from := "[email protected]"
	to := "[email protected]"

	// EnvConfig uses the AWS credentials in the environment variables $AWS_ACCESS_KEY_ID and
	// $AWS_SECRET_KEY.
	res, err := ses.EnvConfig.SendEmail(from, to, "Hello, world!", "Here is the message body.")
	if err == nil {
		fmt.Printf("Sent email: %s...\n", res[:32])
	} else {
		fmt.Printf("Error sending email: %s\n", err)
	}

	// output:
	// Sent email: <SendEmailResponse xmlns="http:/...
}

Running tests

  1. Set the environment variables $AWS_ACCESS_KEY_ID and $AWS_SECRET_KEY and $AWS_SES_ENDPOINT.
  2. Example SES Endpoint https://email.us-west-2.amazonaws.com
  3. Run go test [email protected], where [email protected] is a sender address that is verified in your Amazon SES account.

Contributors

Changelog

2013-06-11 (forked from stathat/amzses)

  • renamed API functions to be consistent with AWS SES API endpoints
  • reads AWS credentials from a Config struct, not from a config file
  • added runnable example_test.go

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.