Developer Tools

SDKs & Libraries

Official client libraries for every major language. Install, configure, and send your first email in minutes.

JS
Node.js
apimailer — npm package
npm install apimailer Install
Example — Send an email
import { ApiMailer } from 'apimailer';

const mailer = new ApiMailer(process.env.APIMAILER_KEY);

const response = await mailer.send({
  from:    'hello@yourdomain.com',
  to:      'user@example.com',
  subject: 'Welcome aboard!',
  html:    '<h1>Welcome!</h1><p>Thanks for signing up.</p>',
});

console.log(response.id); // msg_8f3k2j5n9x
Py
Python
apimailer — PyPI package
pip install apimailer Install
Example — Send an email
import os
from apimailer import ApiMailer

mailer = ApiMailer(os.environ["APIMAILER_KEY"])

response = mailer.send(
    from_addr = "hello@yourdomain.com",
    to        = "user@example.com",
    subject   = "Welcome aboard!",
    html      = "<h1>Welcome!</h1><p>Thanks for signing up.</p>",
)

print(response.id)  # msg_8f3k2j5n9x
Rb
Ruby
apimailer — RubyGems
gem install apimailer Install
Example — Send an email
require 'apimailer'

mailer = ApiMailer::Client.new(ENV['APIMAILER_KEY'])

response = mailer.send(
  from:    'hello@yourdomain.com',
  to:      'user@example.com',
  subject: 'Welcome aboard!',
  html:    '<h1>Welcome!</h1><p>Thanks for signing up.</p>',
)

puts response.id  # msg_8f3k2j5n9x
P
PHP
apimailer/apimailer-php — Composer
composer require apimailer/apimailer-php Install
Example — Send an email
use ApiMailer\Client;

$mailer = new Client(getenv('APIMAILER_KEY'));

$response = $mailer->send([
    'from'    => 'hello@yourdomain.com',
    'to'      => 'user@example.com',
    'subject' => 'Welcome aboard!',
    'html'    => '<h1>Welcome!</h1><p>Thanks for signing up.</p>',
]);

echo $response->id;  // msg_8f3k2j5n9x
Go
Go
apimailer-go — Go module
go get github.com/apimailer/apimailer-go Install
Example — Send an email
package main

import (
    "fmt"
    "os"
    "github.com/apimailer/apimailer-go"
)

func main() {
    client := apimailer.New(os.Getenv("APIMAILER_KEY"))

    resp, err := client.Send(&apimailer.Message{
        From:    "hello@yourdomain.com",
        To:      []string{"user@example.com"},
        Subject: "Welcome aboard!",
        HTML:    "<h1>Welcome!</h1><p>Thanks for signing up.</p>",
    })

    fmt.Println(resp.ID)  // msg_8f3k2j5n9x
}
Jv
Java
com.apimailer:apimailer-java — Maven Central
<dependency> com.apimailer:apimailer-java:1.0.0 </dependency> Maven
Example — Send an email
import com.apimailer.ApiMailer;
import com.apimailer.Message;

var mailer = new ApiMailer(System.getenv("APIMAILER_KEY"));

var response = mailer.send(
    Message.builder()
        .from("hello@yourdomain.com")
        .to("user@example.com")
        .subject("Welcome aboard!")
        .html("<h1>Welcome!</h1><p>Thanks for signing up.</p>")
        .build()
);

System.out.println(response.getId()); // msg_8f3k2j5n9x
Get Started

Ready to send your
first email?

Create a free account, install your SDK, and send an email in under five minutes.