AWS SDK GO is a wrapper library of official library aws-sdk-go-v2. With this library will help you to make it easier for you to use it!
Before you using this library, please read the explanation "How to set the credentials" in this article Before you running this service, please set up your credentials with following this instruction Get your AWS access keys & Where are configuration settings stored?
package main
import (
"context"
"github.com/flip-id/aws-sdk-go/client"
"github.com/flip-id/aws-sdk-go/services/ses"
"fmt"
)
func main() {
service, err := ses.New(context.TODO(), client.APSoutheast1)
if err != nil {
panic(err)
}
messageID, err := service.SendEmail(context.TODO(), ses.RequestSendEmail{
To: []string{"your_email@gmail.com"},
From: "your_email@gmail.com",
Subject: "Testing",
Body: "This is body of email",
Type: ses.TEXTTypeEmail,
})
if err != nil {
panic(err)
}
fmt.Println(messageID)
}