ses

package module
v0.0.0-...-0c4aa0a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

README

SES

Go Report Card PkgGoDev License


An easy way to use the Amazon Simple Email Service(SES) api to send emails.

Installation

go get github.com/Blank-Xu/ses-go

Simple Example

package main

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

func main() {
	api := ses.NewAPI(endpoint, from, accessKeyID, secretAccessKey)

	body, err := api.SendMail(subject, bodyText, toAddresses)
	fmt.Println(body, err)

	body2, err := api.SendHTMLMail(subject, bodyHTML, toAddresses)
	fmt.Println(body2, err)
}

License

This project is under Apache 2.0 License. See the LICENSE file for the full license text.

Documentation

Overview

Package ses An easy way to use the [Amazon Simple Email Service(SES)](https://aws.amazon.com/ses/) api to send emails

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDefaultHTTPClient

func SetDefaultHTTPClient(client http.Client)

SetDefaultHTTPClient set the default http client for this package

Types

type Option

type Option struct {
	// contains filtered or unexported fields
}

Option SES api options

func NewAPI

func NewAPI(endpoint, from, accessKeyID, secretAccessKey string) *Option

NewAPI constructor for SES api

func NewHTTPClientAPI

func NewHTTPClientAPI(client http.Client, endpoint, from, accessKeyID, secretAccessKey string) *Option

NewHTTPClientAPI constructor for SES api with given HTTP client

func (*Option) SendHTMLMail

func (p *Option) SendHTMLMail(subject, bodyHTML string, toAddresses []string) (string, error)

SendHTMLMail send html emails

func (*Option) SendMail

func (p *Option) SendMail(subject, bodyText string, toAddresses []string) (string, error)

SendMail send text emails

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL