-
Notifications
You must be signed in to change notification settings - Fork 64
Example Usage
Brian Lachniet edited this page Jul 3, 2014
·
1 revision
package main
import (
"github.com/mattbaird/gochimp"
)
func main() {
// Create a Mandrill object to interact with the Mandrill API
mandrill, err := gochimp.NewMandrill("MyMandrillApiKey")
if err != nil {
panic(err)
}
// Create a mail message.
msg := gochimp.Message{
To: []gochimp.Recipient{gochimp.Recipient{Email: "[email protected]"}},
Subject: "Hello",
Html: "Hi Bob. It's me, <strong>Alice</strong>",
FromEmail: "[email protected]",
}
// Send the mail message using the Mandrill object.
_, err = mandrill.MessageSend(msg, false)
if err != nil {
panic(err)
}
}