Skip to main content
The official Go SDK is a typed, zero-dependency client for Go 1.22+. It uses context.Context for cancellation and deadlines, exports typed request/response models, and is safe for concurrent use.

pkg.go.dev

github.com/WazobiaMail/wazobiamail-go

Source

WazobiaMail/wazobiamail-go

At a glance

Install

Configure

The SDK sends X-API-Key; use WithAccessToken for an account Bearer token. Pass a context.Context to every call.

Send your first email

Set IdempotencyKey in SendMessageRequest for safe retries. Use SendWithAttachments for binary files, or UploadAttachment to get a public URL first.

What you can do

  • Messages — send, multipart attachments, tracking/logs and spam checks.
  • Domains — list/create/update/delete, DNS records, verification and Cloudflare DNS.
  • Mailboxes — provisioning, credentials, storage and headless inbox messages.
  • APIKeys, SMTP — scoped keys, relays and SMTP access.
  • Billing, Units, Plans, Status — invoices, subscriptions, credits, limits and account health.
  • Support, Templates — support threads and Enterprise templates.
  • Webhooks — HMAC SHA-256 signature verification without a network call.

Spam-check scores

Messages.SpamCheck returns a penalty Score, a Threshold, an IsSpam flag and an inverse DeliverabilityScore (0–100, higher is better). IsSpam is true when Score >= Threshold; read Threshold from the response instead of hard-coding 5.0. See Spam and deliverability scores.

Webhooks

Always verify the raw request body. VerifySignature accepts a hex HMAC SHA-256 value with an optional sha256= prefix.

Errors

APIError exposes StatusCode, Message, Code, Errors, Body and RetryAfter.

Concurrency

A *Client is safe for concurrent use and holds an *http.Client; reuse one instance across goroutines. Each request accepts a context, so cancel or time out individual calls without recreating the client.