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 an account

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