MillionSend Docs

SDKs

SDKs oficiais do MillionSend para nove linguagens, publicados sob MIT.

Cada SDK espelha o formato do SDK oficial correspondente do Resend, então migrar é quase um localizar-e-substituir: troque o import/classe e aponte a URL base para o MillionSend. Todos os SDKs são licenciados sob MIT e vivem em repositórios próprios na organização MillionSend no GitHub.

Como a API é compatível na comunicação com a do Resend, os SDKs oficiais do Resend também funcionam — aponte-os para o MillionSend pela opção de URL base (ex.: RESEND_BASE_URL).

URL base

api.millionsend.com — o que todos os exemplos desta página usam, e o padrão a partir do SDK 0.5.0: sem uma base URL configurada, o SDK fala com o Cloud.

Node.js / TypeScript

millionsend no npm — Node 18+.

npm install millionsend
import { MillionSend } from "millionsend";

const ms = new MillionSend("ms_123", { baseUrl: "https://api.millionsend.com" });

const { data, error } = await ms.emails.send({
  from: "Acme <[email protected]>",
  to: "[email protected]",
  subject: "Hello from MillionSend",
  html: "<strong>It works!</strong>",
});

Python

millionsend no PyPI — Python 3.9+.

pip install millionsend
import millionsend

millionsend.api_key = "ms_123"
millionsend.base_url = "https://api.millionsend.com"

email = millionsend.Emails.send({
    "from": "Acme <[email protected]>",
    "to": "[email protected]",
    "subject": "Hello from MillionSend",
    "html": "<strong>It works!</strong>",
})

Go

millionsend-go — Go 1.21+.

go get github.com/MillionSend/millionsend-go
client := millionsend.NewClient("ms_123")
client.BaseURL = "https://api.millionsend.com"

sent, err := client.Emails.Send(&millionsend.SendEmailRequest{
    From:    "Acme <[email protected]>",
    To:      []string{"[email protected]"},
    Subject: "Hello from MillionSend",
    Html:    "<strong>It works!</strong>",
})

Ruby

millionsend no RubyGems — Ruby 3.0+.

gem install millionsend
require "millionsend"

Millionsend.api_key  = "ms_123"
Millionsend.base_url = "https://api.millionsend.com"

email = Millionsend::Emails.send(
  from: "Acme <[email protected]>",
  to: "[email protected]",
  subject: "Hello from MillionSend",
  html: "<strong>It works!</strong>"
)

PHP

millionsend/millionsend-php no Packagist — PHP 8.1+.

composer require millionsend/millionsend-php
use MillionSend\MillionSend;

$ms = MillionSend::client('ms_123', 'https://api.millionsend.com');

$email = $ms->emails->send([
    'from' => 'Acme <[email protected]>',
    'to' => '[email protected]',
    'subject' => 'Hello from MillionSend',
    'html' => '<strong>It works!</strong>',
]);

Rust

millionsend no crates.io — async (tokio + reqwest).

[dependencies]
millionsend = "0.2"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
use millionsend::{MillionSend, SendEmailOptions};

let ms = MillionSend::with_base_url("ms_123", "https://api.millionsend.com");

let sent = ms.emails.send(&SendEmailOptions {
    from: "Acme <[email protected]>".into(),
    to: "[email protected]".into(),
    subject: "Hello from MillionSend".into(),
    html: Some("<strong>It works!</strong>".into()),
    ..Default::default()
}).await?;

Java

com.millionsend:millionsend-java no Maven Central — Java 11+.

<dependency>
  <groupId>com.millionsend</groupId>
  <artifactId>millionsend-java</artifactId>
  <version>0.2.0</version>
</dependency>
MillionSend ms = new MillionSend("ms_123", "https://api.millionsend.com");

CreateEmailResponse sent = ms.emails().send(
    CreateEmailOptions.builder()
        .from("Acme <[email protected]>")
        .to("[email protected]")
        .subject("Hello from MillionSend")
        .html("<strong>It works!</strong>")
        .build());

.NET

MillionSend no NuGet — alvo net8.0.

dotnet add package MillionSend
using MillionSend;

var client = new MillionSendClient("ms_123", "https://api.millionsend.com");

var res = await client.EmailSendAsync(new EmailMessage
{
    From = "Acme <[email protected]>",
    To = "[email protected]",
    Subject = "Hello from MillionSend",
    Html = "<strong>It works!</strong>",
});

Elixir

millionsend no Hex — Elixir 1.15+.

# mix.exs
def deps do
  [{:millionsend, "~> 0.2"}]
end
config :millionsend, MillionSend.Client,
  api_key: System.get_env("MILLIONSEND_API_KEY"),
  base_url: "https://api.millionsend.com"

{:ok, email} =
  MillionSend.Emails.send(%{
    from: "Acme <[email protected]>",
    to: "[email protected]",
    subject: "Hello from MillionSend",
    html: "<strong>It works!</strong>"
  })

Nesta página