Skip to content

Instantly share code, notes, and snippets.

@schoettker
Created January 30, 2018 18:20
Show Gist options
  • Select an option

  • Save schoettker/abdc03ca970a2e3fd815cd12bb500a97 to your computer and use it in GitHub Desktop.

Select an option

Save schoettker/abdc03ca970a2e3fd815cd12bb500a97 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"github.com/mailjet/mailjet-apiv3-go"
)
func main() {
publicKey := "XXXXX"
secretKey := "XXXXX"
mj := mailjet.NewMailjetClient(publicKey, secretKey)
param := &mailjet.InfoSendMail{
FromEmail: "lennart.schoettker@atmina.de",
FromName: "Max Mustermann",
Recipients: []mailjet.Recipient{
mailjet.Recipient{
Email: "lennartschoettker@hotmail.com",
},
},
Subject: "Hello World!",
TextPart: "Hi there !",
}
res, err := mj.SendMail(param)
if err != nil {
fmt.Println(err)
} else {
fmt.Println("Success")
fmt.Println(res)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment