-
Notifications
You must be signed in to change notification settings - Fork 63
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: "bob@example.com"}},
Subject: "Hello",
Html: "Hi Bob. It's me, <strong>Alice</strong>",
FromEmail: "alice@example.com",
}
// Send the mail message using the Mandrill object.
_, err = mandrill.MessageSend(msg, false)
if err != nil {
panic(err)
}
}