Learn how to send your first email using the Resend Go SDK.
go get github.com/resend/resend-go/v2
html
package main import "github.com/resend/resend-go/v2" func main() { apiKey := "re_xxxxxxxxx" client := resend.NewClient(apiKey) params := &resend.SendEmailRequest{ From: "Acme <onboarding@resend.dev>", To: []string{"delivered@resend.dev"}, Html: "<strong>hello world</strong>", Subject: "Hello from Golang", Cc: []string{"cc@example.com"}, Bcc: []string{"bcc@example.com"}, ReplyTo: "replyto@example.com", } sent, err := client.Emails.Send(params) if err != nil { fmt.Println(err.Error()) return } fmt.Println(sent.Id) }
Was this page helpful?