Transactional email API for Go

Start sending emails from your Golang applications in minutes with a dependably fast transactional messaging platform.

MailerSend

Integrates easily with your Go app

Implement fast, production-ready transactional email into your Go apps with MailerSend’s intuitive API, Golang SDK, and comprehensive documentation.
Read our API docs
package main

import (
    "context"
    "os"
    "fmt"
    "time"

    "github.com/mailersend/mailersend-go"
)

func main() {
	// Create an instance of the mailersend client
	ms := mailersend.NewMailersend(os.Getenv("MAILERSEND_API_KEY"))

	ctx := context.Background()
	ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
	defer cancel()

	subject := "Subject"
	text := "This is the text content"
	html := "

This is the HTML content

" from := mailersend.From{ Name: "Your Name", Email: "your@domain.com", } recipients := []mailersend.Recipient{ { Name: "Your Client", Email: "your@client.com", }, } // Send in 5 minute sendAt := time.Now().Add(time.Minute * 5).Unix() tags := []string{"foo", "bar"} message := ms.Email.NewMessage() message.SetFrom(from) message.SetRecipients(recipients) message.SetSubject(subject) message.SetHTML(html) message.SetText(text) message.SetTags(tags) message.SetSendAt(sendAt) message.SetInReplyTo("client-id") res, _ := ms.Email.Send(ctx, message) fmt.Printf(res.Header.Get("X-Message-Id")) }
MailerSend

Support for simple SMTP integrations

Reliable, secure SMTP server integration is available for compatibility with legacy systems or more basic configurations using native or community-based Go packages.

MailerSend

Optimized for deliverability at every layer

From infrastructure to sending practices, deliverability is built into every layer of our platform, ensuring fast, trusted inbox delivery for your Go app’s transactional emails.

MailerSend

Inbound email processing

Route incoming emails to your Go app or other integrated platforms. Improve customer support ticketing, add email-based functionality, and enable 2-way messaging.

MailerSend

Build, customize and personalize emails

Build dynamic templates with the HTML and drag and drop builders for personalized messaging at scale. Plus, use custom headers to customize tracking and unsubscribe headers, and pass other data. 

MailerSend

One account to manage multiple senders

Use multiple domains and sender identities to manage the transactional email of all your clients or brands, while keeping settings and data separate.

MailerSend

User permissions you can tailor to each person

Assign admin, manager, designer or accountant rights, or handpick the settings, features and templates a user can access with a completely custom role.

Technical support you can rely on

Whether you need help troubleshooting or some friendly guidance about an advanced feature, our award-winning support team is just a click away.

93% satisfaction rate
100% response rate
24/7 support hours
I would recommend MailerSend because of the great support I got every time I struggled with something. Fast response times and competent help is my main experience so far. The API documentation and integration are straightforward. Templates can be handled by marketing without developer skills.
Norbert N. CTO
Before MailerSend, we were always worried that emails would go to spam or promotions, but now our clients sometimes ask "How did your FIRST email get into my inbox with a star on it?". For us, email is critical for the businesses that we help and MailerSend plays a critical role. Better still, they have humans that respond and read what you write to them.
Rodrigo S. CEO
Very good tool, it took me just one day to get it working on production. The interface is clean with everything exactly where expected. It works fantastically—emails are delivered immediately and as configured (conditional statements saved my life, no need to create lots of templates). The API documentation is also fantastic, plus the support team is really fast! 10 out of 10.
Roger S. -

Get started for free

Try out MailerSend’s email API and Go SDK for free and send your first email in minutes with a trial domain. Subscribe to a Free plan for up to 500 emails/month or upgrade for as little as $7/month.

Pricing

Four simple plans, no hidden costs. Start with 500 emails/month for free and upgrade to get more volume or features.
How many emails do you plan to send?
3K
Pricing in Euros and British Pounds is for informational purposes only. All billing invoices will be charged in US dollars.
Recommended
Professional

For agencies and white-label resellers sending at scale

$88.00 /month
$1,056.00 billed yearly
81.12 /month
€973.39 billed yearly
£68.23 /month
£818.79 billed yearly
$110.00 /month 101.39 /month £85.29 /month
50,000 emails /month
150 SMS /month
400 email verification credits
Extra usage
$0.90 0.90 £0.90 /1,000 emails
$1.40 1.40 £1.40 /100 SMS
Recommended
Starter

For growing startups and small businesses

$28.00 /month
$336.00 billed yearly
25.81 /month
€309.71 billed yearly
£21.71 /month
£260.53 billed yearly
$35.00 /month 32.26 /month £27.14 /month
50,000 emails /month
100 SMS /month
100 email verification credits
Extra usage
$0.90 0.90 £0.90 /1,000 emails
$1.40 1.40 £1.40 /100 SMS
Recommended
Hobby

For personal projects and side hustles

$ 5.60 /month
$67.20 billed yearly
5.15 /month
€61.83 billed yearly
£4.43 /month
£53.18 billed yearly
$7.00 /month 6.44 /month £5.53 /month
5,000 emails
100 email verification credits
Extra usage
$1.20 1.20 £1.20 /1,000 emails
Free

For occasional email testing and sending

$0
500 emails
10 email verification credits
Enterprise

For large organizations with special requirements

Designed for scale — includes everything in Professional, plus:
  • 14-days API logs retention
  • Enterprise-grade support
  • Dedicated IP
*Learn more about plan limits.   |   Taxes may apply, learn more.

FAQs

How does the SDK handle API rate limiting and retries in a concurrent Go application?

API requests to the email endpoint are limited at 120 requests per minute. You can also use the bulk email endpoint to send multiple messages in a single request and optimize your email sendings. 

How does the Go SDK handle dynamic data when using MailerSend's HTML templates?

Dynamic data for email templates is handled through template personalization variables that are passed when the email is sent. The variables are inserted into your stored template when the email is rendered. Learn more about how to use personalization

Can I send bulk or batch emails using the SDK to improve API efficiency?

Yes, the bulk email endpoint can be used to send up to 500 emails in a single request, each with up to 50 recipients. 

Does MailerSend support webhook validation within a Go application?

Webhook requests made by MailerSend include a Signature header, which you can validate in Go to verify the request. Check out our developer guide to learn more and get the sample code for verifying a signature.