go/ses/README.md
These examples demonstrate how to perform several Amazon Simple Email Service (Amazon SES) operations.
You must have an AWS account, and have your default credentials and AWS Region configured as described in Configuring the AWS SDK for Go in the AWS SDK for Go Developer Guide.
This example deletes an Amazon SES email address.
go run DeleteAddress -a ADDRESS
The unit test mocks the service client and the DeleteVerifiedEmailAddress function.
This example retrieves statistics about Amazon SES send operations.
go run GetStatistics.go
The unit test mocks the service client and the GetSendStatistics function.
This example lists the verified SES email addresses.
go run ListAddresses.go
The unit test mocks the service client and the ListIdentities and GetIdentityVerificationAttributes functions.
This example sends an email message to a recipient.
go run SendMessage.go -f SENDER -t RECIPIENT [-s SUBJECT]
The unit test mocks the service client and the SendEmail function.
This example verifies an email address.
go run VerifyAddress -r RECIPIENT
The unit test mocks the service client and the VerifyEmailAddress function.
Unit tests should delete any resources they create. However, they might result in charges to your AWS account.
To run a unit test, enter the following.
go test
You should see something like the following, where PATH is the path to the folder containing the Go files.
PASS
ok PATH 6.593s
To see any log messages, enter the following.
go test -test.v
You should see additional log messages. The last two lines should be similar to the previous output shown.
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0