I was working on a freelance project that needed transactional email. ZeptoMail made sense because of the low cost, but there was no Go SDK for it. So I wrote one.

A zero-dependency Go SDK for the ZeptoMail email delivery API by Zoho. Built entirely with Go’s standard library, it provides a clean and idiomatic interface for integrating transactional email into Go applications.

GitHub: github.com/navnitms/zeptomail-sdk-go

Features

  • Email Sending - Send individual and batch emails with merge field support
  • Template Management - Create, modify, and send templated emails
  • File Handling - Upload and cache files for use as attachments and inline images
  • Structured Error Handling - Detailed API error responses with status information
  • Customizable HTTP Client - Configurable timeout and transport settings
  • Zero Dependencies - Built using only Go’s standard library

Installation

1
go get github.com/navnitms/zeptomail-sdk-go

Quick Start

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package main

import (
    "context"
    "fmt"

    "github.com/navnitms/zeptomail-sdk-go/v2/zeptomail"
)

func main() {
    client := zeptomail.New("your-api-key")

    resp, err := client.SendMail(context.Background(), zeptomail.SendMailRequest{
        From:    zeptomail.EmailAddress{Address: "[email protected]", Name: "My App"},
        To:      []zeptomail.Recipient{{EmailAddress: zeptomail.EmailAddress{Address: "[email protected]"}}},
        Subject: "Hello from ZeptoMail",
        HTMLBody: "<h1>Hello!</h1>",
    })
    if err != nil {
        panic(err)
    }

    fmt.Println("Email sent:", resp.Message)
}

License

MIT