Go Quickstart
Send your first email with the Mailofly Go SDK. Requires: Go 1.22+ · API key · Account key1. Install
2. Send an email
3. Check mail logs
Next
- Go SDK — full reference
- Sending examples
- API: Emails
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
go get github.com/teamredevs/mailofly-go@latest
package main
import (
"fmt"
"os"
"github.com/teamredevs/mailofly-go"
)
func main() {
client, err := mailofly.New(mailofly.Options{
APIKey: os.Getenv("MAILOFLY_API_KEY"),
})
if err != nil {
panic(err)
}
result, err := client.Emails.Send(map[string]any{
"from": "Acme <onboarding@example.com>",
"to": []string{"you@example.com"},
"subject": "Hello from Mailofly",
"html": "<p>It works!</p>",
})
if err != nil {
panic(err)
}
fmt.Println(result)
}
client.MailLogs.List(&mailofly.MailLogsListOptions{Page: 1, PageSize: 10})