Documentation ¶
Overview ¶
Package ses sends emails using the Amazon AWS Simple Email Service (SES).
Copyright 2013 SourceGraph, Inc. Copyright 2011-2013 Numrotron Inc. Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.
Example ¶
// Change the From address to a sender address that is verified in your Amazon SES account. from := "notify@sourcegraph.com" to := "success@simulator.amazonses.com" // 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:/...
Index ¶
- Variables
- type Config
- func (c *Config) SendEmail(from, to, subject, body string) (string, error)
- func (c *Config) SendEmailHTML(from, to, subject, bodyText, bodyHTML string) (string, error)
- func (c *Config) SendEmailWithReplyTo(from, to, replyTo, subject, body string) (string, error)
- func (c *Config) SendRawEmail(raw []byte) (string, error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EnvConfig = Config{ AccessKeyID: os.Getenv("AWS_ACCESS_KEY_ID"), SecretAccessKey: os.Getenv("AWS_SECRET_KEY"), }
EnvConfig takes the access key ID and secret access key values from the environment variables $AWS_ACCESS_KEY_ID and $AWS_SECRET_KEY, respectively.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // AccessKeyID is your Amazon AWS access key ID. AccessKeyID string // SecretAccessKey is your Amazon AWS secret key. SecretAccessKey string }
Config specifies configuration options and credentials for accessing Amazon SES.
func (*Config) SendEmailHTML ¶
func (*Config) SendEmailWithReplyTo ¶
Click to show internal directories.
Click to hide internal directories.