Skip to main content
This guide covers the fundamental operations for sending emails with the Resend Go SDK.

Initialize the Client

First, create a Resend client with your API key:

Send a Basic Email

The simplest way to send an email:

Email with HTML Content

Send rich HTML emails:
Providing both Html and Text ensures your email renders properly in all email clients.

Advanced Recipients

Add CC, BCC, and ReplyTo addresses:

Send with Idempotency Key

Prevent duplicate emails by using an idempotency key:
If you send the same request with the same idempotency key within 24 hours, Resend will return the original response instead of sending a duplicate email.

Send with Attachments

Attach files from local paths or remote URLs:

Retrieve Email Details

Get information about a sent email:

List Sent Emails

Retrieve a list of sent emails with pagination:

Manage Attachments

List and retrieve email attachments:

Complete Example

Here’s a complete example from examples/send_email.go:
examples/send_email.go

Next Steps

Templates

Use email templates with dynamic variables

Error Handling

Handle rate limits and validation errors

Custom Client

Configure HTTP client with custom timeouts and retry logic

API Reference

View complete API documentation