Send email from your app!

The world’s most powerful email delivery solution is now yours in a developer-friendly, quick to set up cloud service.

curl -XPOST https://api.sparkpost.com/api/v1/transmissions \
  -H "Authorization: <YOUR API KEY>" \
  -H "Content-Type: application/json" \
  -d '{
      "options": { "sandbox": true },
      "content": {
      "from": "testing@sparkpostbox.com",
      "subject": "Oh hey",
      "html": "<html><body><p>Testing SparkPost - the most awesomest email service!</p></body></html>"
    },
    "recipients": [ { "address": "developers+curl@sparkpost.com" } ]
  }'
const SparkPost = require('sparkpost');
const sparky = new SparkPost('<YOUR API KEY>');

sparky.transmissions.send({
  options: { sandbox: true },
  content: {
    from: 'testing@sparkpostbox.com',
    subject: 'Oh hey',
    html:'<html><body><p>Testing SparkPost - the most awesomest email service!</p></body></html>'
  },
  recipients: [ { address: 'developers+nodejs@sparkpost.com' } ]
})
.then(data => {
  console.log('Woohoo! You just sent your first mailing!');
})
.catch(err => {
  console.log('Whoops! Something went wrong');
});
from sparkpost import SparkPost

sparky = SparkPost('<YOUR API KEY>')

response = sparky.transmissions.send(
    use_sandbox = True,
    recipients = ['developers+python@sparkpost.com'],
    html = '<html><body><p>Testing SparkPost - the most awesomest email service!</p></body></html>',
    from_email = 'testing@sparkpostbox.com',
    subject = 'Oh hey')
<?php
use SparkPostSparkPost;
use GuzzleHttpClient;
use HttpAdapterGuzzle6Client as GuzzleAdapter;

$httpClient = new GuzzleAdapter(new Client());
$sparky = new SparkPost($httpClient, ['key' => '<YOUR API KEY>']);

$sparky->setOptions(['async' => false]);
$results = $sparky->transmissions->post([
  'options' => [
    'sandbox' => true
  ],
  'content' => [
    'from' => 'testing@sparkpostbox.com',
    'subject' => 'Oh hey',
    'html' => '<html><body><p>Testing SparkPost - the most awesomest email service!</p></body></html>'
  ],
  'recipients' => [
    ['address' => ['email'=>'developers+php@sparkpost.com']]
  ]
]);
?>
package com.sparkpost;

import com.sparkpost.exception.SparkPostException;

public class SparkPost {

    public static void main(String[] args) throws SparkPostException {
        String API_KEY = "<YOUR API KEY>";
        Client sparky = new Client(API_KEY);

        sparky.sendMessage(
                "testing@sparkpostbox.com",
                "developers+java@sparkpost.com",
                "Oh hey",
                "Testing SparkPost - the most awesomest email service!",
                "<html><body><p>Testing SparkPost - the most awesomest email service!</p></body></html>");
    }
}
package main

import (
    sp "github.com/SparkPost/gosparkpost"
    "log"
)

func main() {
    var sparky sp.Client
    err := sparky.Init(&sp.Config{ApiKey: "<YOUR API KEY>"})
    if err != nil {
        log.Fatalf("SparkPost client init failed: %s\n", err)
    }

    tx := &sp.Transmission{
        Recipients: []string{"developers+go@sparkpost.com"},
        Options:    &sp.TxOptions{Sandbox: true},
        Content: sp.Content{
            HTML:    "<html><body><p>Testing SparkPost - the most awesomest email service!</p></body></html>",
            From:    "testing@sparkpostbox.com",
            Subject: "Oh hey",
        },
    }
    id, _, err := sparky.Send(tx)
    if err != nil {
        log.Fatal(err)
    }

    log.Printf("Transmission sent with id [%s]\n", id)
}
alias SparkPost.{Content, Transmission}

defmodule MyApp do
  def main(args) do
    Transmission.send(%Transmission{
      recipients: ["developers+elixir@sparkpost.com"],
      content: %Content.Inline{
        from: "testing@sparkpostbox.com",
        subject: "Oh hey",
        html: "<html><body><p>Testing SparkPost - the most awesomest email service!</p></body></html>",
      },
      options: %Transmission.Options{sandbox: true}
    })
  end
end
// Maintained by community member Darren Cauthon, endorsed by SparkPost
using SparkPost;

var transmission = new Transmission();
transmission.Content.From.Email = "testing@sparkpostbox.com";
transmission.Content.Subject = "Oh hey";
transmission.Content.Html = "<html><body><p>Testing SparkPost - the most awesomest email service!</p></body></html>";

var recipient = new Recipient
{
  Address = new Address { Email = "developers+csharp@sparkpost.com" }
};
transmission.Recipients.Add(recipient);

var sparky = new Client("<YOUR API KEY>");
sparky.Transmissions.Send(transmission);

Steps to Start Sending

Start sending with the most powerful email platform. Check out the full guide to get started.

Sign up for a developer account

Create a free developer account to start sending up to 15,000 emails every month.

Sign up

Set up your domain

Add the domain you want to send from and verify you own it through DNS settings.

Add a sending domain

Start sending!

Send emails from your domain using the API or SMTP. You can also send with your favorite programming language using any of our official or community supported client libraries.

Send your first email

Engineering Blog

Support for Google AMP for Email in SparkPost Coming Soon

We’re working with Google to add support for Accelerated Mobile Pages (AMP) for Email to the SparkPost service. Here’s a preview of how it works.

read more

5 Best Practices for Running a Successful Remote Team

Our top 5 best practices for running a successful remote team will help you foster positive morale on your team as remote work becomes more ubiquitous.

read more

The Bayesian Logic in SparkPost’s A/B Testing API

Our new API feature for A/B testing transactional emails uses a statistical algorithm, Bayesian Logic, for picking the winning variant of the message.

read more