Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Go package to send email using Amazon's SES
Go
branch: master

This branch is 4 commits ahead, 4 commits behind stathat:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
LICENSE
README.md
amzses.go

README.md

amzses

This is a Go package to send emails using Amazon's Simple Email Service.

Installation

Use go get:

go get github.com/alltom/amzses

If you are building your code with goinstall, you can skip the previous step and just import amzses as follows:

import (
        "github.com/alltom/amzses"
)

Using go install will automatically install its one external dependency, jconfig.

Usage

Optionally, save your credentials in /etc/aws.conf:

{
    "aws_access_key": "XXX_YOUR_ACCESS_KEY_XXX",
    "aws_secret_key": "YYY_YOUR_SECRET_KEY_YYY"
}

Then create and use an ses object:

ses := amzses.Init() // credentials loaded from /etc/aws.conf
ses := amzses.InitAuth("XXX_YOUR_ACCESS_KEY_XXX", "YYY_YOUR_SECRET_KEY_YYY")

_, err := ses.SendMail("info@example.com", "user@gmail.com", "Welcome!", "Welcome to our project!\n\n...")

The first return value is the response string from the server. To extract the message and request IDs:

var resp amzses.AmazonResponse
err := xml.Unmarshal([]byte(s), &resp)
// resp.MessageId, resp.RequestId

Status

The modifications in this fork (alltom/amzses) haven't really been tested at all, but the original library (stathat/amzses) was in use at StatHat in production, so it's probably in pretty good shape.

About

The original library was written by Patrick Crosby at StatHat. Twitter: @stat_hat

Something went wrong with that request. Please try again.