Unofficial Mailtrap API client for Go.
The public API documentation is available at https://api-docs.mailtrap.io.
NOTE: THIS PACKAGE IS STILL UNDER DEVELOPMENT.
go get github.com/vorobeyme/mailtrap-go
import "github.com/vorobeyme/mailtrap-go"
Create a new Mailtrap client, then use the exposed services to access different parts of the Mailtrap API.
package main
import (
"log"
"github.com/vorobeyme/mailtrap-go"
)
func main() {
client, err := mailtrap.NewSendingClient("api-token")
if err != nil {
log.Fatal(err)
}
email := &mailtrap.SendEmailRequest{ ... }
resp, _, err := client.SendEmail.Send(email)
}
To find code examples that demonstrate how to call the Mailtrap API client for Go, see the examples folder.