Send email from Go with the standard library.
Go needs no Notix package: the API is one HTTPS POST, and net/http with encoding/json covers it. Give every request a context with a deadline and an idempotency key, and the send is safe to retry from a worker or a handler.
Send an email from Go.
body, _ := json.Marshal(map[string]any{
"from": "Acme <receipts@acme.com>",
"to": "maria@example.com",
"subject": "Your receipt",
"html": "<p>Thanks for your order.</p>",
})
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
req, _ := http.NewRequestWithContext(ctx, http.MethodPost, "https://app.usenotix.dev/api/v1/emails", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("NOTIX_API_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", "order-4471-receipt")
resp, err := http.DefaultClient.Do(req)
The from address must be on a domain you have verified in Notix. Step by step: the cURL quickstart and the longer guide to sending email from Go.
One API key, kept on the server.
Create an API key on the API keys page of the Notix console and store it as NOTIX_API_KEY in the process environment. Read it only in code that runs on the server, never in anything shipped to a browser.
A Send only key is enough for code that only sends: if it leaks, it cannot read your contacts or delete a domain.
NOTIX_API_KEY=notix_xxxxxxxxxxxx
NOTIX_WEBHOOK_SECRET=whsec_xxxxxxxxxxxx
Or point net/smtp at the relay.
The relay is smtp.usenotix.dev on port 465 (implicit TLS) or 587 (STARTTLS). The username is always notix and the password is your API key, so net/smtp sends through Notix without new code. Mail sent this way gets the same suppression list, tracking and webhooks as the API.
auth := smtp.PlainAuth("", "notix", os.Getenv("NOTIX_API_KEY"), "smtp.usenotix.dev")
err := smtp.SendMail("smtp.usenotix.dev:587", auth, "receipts@acme.com", []string{"maria@example.com"}, message)
Questions, answered.
Is there a Notix SDK for Go?
What if the same request runs twice?
Why is my send refused with a from-address error?
Keep reading.
Send email from Go
The Go package or net/http against the JSON API, then net/smtp through the relay, with context and retries.
DocscURL
Send an email with one HTTP request from your terminal.
IntegrationsIntegrations
Notix inside the frameworks, platforms and AI coding tools you already use, from Next.js and Laravel to Supabase, Vercel and Cursor.
ProductEmail API
One JSON API for transactional and marketing email: send, batch, schedule, webhooks, typed SDKs.
NotixPricing
A free plan with no card, and Pro at $15 a month for 50,000 emails. Only sent volume is metered.
Send your first email in five minutes.
Verify a domain, copy an API key, make one call. The free plan does not ask for a card.