All frameworks

Send Email from Fiber

Send emails from Fiber with Express-like syntax

1

Install the SDK

go get github.com/sendpigeon/sendpigeon-go
2

Set your API key

SENDPIGEON_API_KEY=your_api_key_here

Get your API key from the dashboard.

3

Send your first email

go
package main

import (
	"os"

	"github.com/gofiber/fiber/v2"
	"github.com/sendpigeon/sendpigeon-go/sendpigeon"
)

func main() {
	client := sendpigeon.New(os.Getenv("SENDPIGEON_API_KEY"))
	app := fiber.New()

	app.Post("/contact", func(c *fiber.Ctx) error {
		var req struct {
			Email string `json:"email"`
			Name  string `json:"name"`
		}
		c.BodyParser(&req)

		client.Send(c.UserContext(), sendpigeon.SendEmailRequest{
			To:      []string{req.Email},
			From:    "hello@yourdomain.com",
			Subject: "Thanks for reaching out, " + req.Name + "!",
			HTML:    "<h1>We got your message</h1><p>We'll get back to you soon.</p>",
		})

		return c.JSON(fiber.Map{"success": true})
	})

	app.Listen(":3000")
}

Why use SendPigeon with Fiber?

  • Express-like syntax
  • Zero memory allocation
  • Fasthttp powered
  • 99.9% deliverability with dedicated IPs
  • Real-time analytics and webhook events
🧪

Testing locally? Use our local email server to catch emails without sending real ones.

🎨

Prefer visual editing? Build email templates with our free drag-and-drop builder. Learn more →

Ready to send emails from Fiber?

Start free with 3,000 emails/month. No credit card required.

Get Started Free

Other go frameworks