Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- mailgun "github.com/mailgun/mailgun-go"
- )
- func main() {
- mg := mailgun.NewMailgun(
- "your domain",
- "your api key", // API Key
- "", // API Public Key (we don't use)
- )
- var recipients = []struct {
- Email string
- }{
- {"recipient1@example.com"},
- {"recipient2@example.com"},
- {"recipient3@example.com"},
- }
- msg := mg.NewMessage(
- "sender@example.com",
- "subject",
- "text",
- )
- msg.SetHtml("your html")
- for _, recipient := range recipients {
- err := m.AddRecipient(recipient.Email)
- if err != nil {
- fmt.Println(err)
- }
- }
- mg.Send(msg)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement