Drive email entirely from Go: send with one call, receive every inbound message as parsed JSON on a webhook, and give any app or AI agent its own inbox on a domain you control — with no mail server to run.
Add the Go library:
go get github.com/mailkite/mailkite-go One endpoint, one API key — over your own authenticated domain. Send API reference →
mk := mailkite.New(os.Getenv("MAILKITE_API_KEY"))
res, err := mk.Send(mailkite.Message{
From: "hello@myapp.ai",
To: "ada@example.com",
Subject: "Your invoice #1042",
HTML: "<p>Thanks! Receipt attached.</p>",
}) Point your domain's MX at MailKite and every message arrives as parsed JSON — verify the signature, then handle it. No IMAP, no mail server.
http.HandleFunc("/hooks/mailkite", func(w http.ResponseWriter, r *http.Request) {
rawBody, _ := io.ReadAll(r.Body)
sig := r.Header.Get("x-mailkite-signature")
if !mailkite.VerifyWebhook(sig, string(rawBody), secret) {
w.WriteHeader(http.StatusUnauthorized)
return
}
var event map[string]any
json.Unmarshal(rawBody, &event)
// ...handle event["type"] == "email.received"
w.Header().Set("content-type", "application/json")
w.Write([]byte(mailkite.ReplyOk())) // {"status":"ok"}
}) Go deeper: Email to webhook: the complete guide, or give an AI agent its own inbox.
Send, receive, and agent inboxes — the same shape in every language. See the full picture →
Unlimited domains ·Unlimited mailboxes ·3,000 emails/mo — 100 emails/day. Pricing →