· 7 years ago · Feb 13, 2018, 03:08 PM
1package main
2
3import (
4 "fmt"
5
6 "github.com/mailjet/mailjet-apiv3-go"
7)
8
9func main() {
10 publicKey := "XXXXX"
11 secretKey := "XXXXX"
12
13 mj := mailjet.NewMailjetClient(publicKey, secretKey)
14
15 param := &mailjet.InfoSendMail{
16 FromEmail: "lennart.schoettker@atmina.de",
17 FromName: "Max Mustermann",
18 Recipients: []mailjet.Recipient{
19 mailjet.Recipient{
20 Email: "lennartschoettker@hotmail.com",
21 },
22 },
23 Subject: "Hello World!",
24 TextPart: "Hi there !",
25 }
26 res, err := mj.SendMail(param)
27 if err != nil {
28 fmt.Println(err)
29 } else {
30 fmt.Println("Success")
31 fmt.Println(res)
32 }
33}