Integrate today.
One REST call to send from your domain. Mail lands in your mailbox, Sent folder, and Outlook — same place as webmail.
const res = await fetch('https://app.llamaemail.com/v1/emails', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LLAMAEMAIL_API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': crypto.randomUUID(),
},
body: JSON.stringify({
from: 'hello@yourdomain.com',
to: 'friend@example.com',
subject: 'Hello World',
html: '<strong>It works.</strong>',
}),
});
const email = await res.json();
console.log(email);
// app/api/send/route.ts
import { NextResponse } from 'next/server';
export async function POST() {
const res = await fetch('https://app.llamaemail.com/v1/emails', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LLAMAEMAIL_API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': crypto.randomUUID(),
},
body: JSON.stringify({
to: 'friend@example.com',
subject: 'Hello from Next.js',
html: '<p>Sent from your domain.</p>',
}),
});
return NextResponse.json(await res.json(), { status: res.status });
}
import os, uuid, requests
response = requests.post(
'https://app.llamaemail.com/v1/emails',
headers={
'Authorization': f"Bearer {os.environ['LLAMAEMAIL_API_KEY']}",
'Idempotency-Key': str(uuid.uuid4()),
},
json={
'from': 'hello@yourdomain.com',
'to': 'friend@example.com',
'subject': 'Hello World',
'html': '<strong>It works.</strong>',
},
)
print(response.json())
<?php
$res = curl_init('https://app.llamaemail.com/v1/emails');
curl_setopt_array($res, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LLAMAEMAIL_API_KEY'),
'Content-Type: application/json',
'Idempotency-Key: ' . uuid_create(),
],
CURLOPT_POSTFIELDS => json_encode([
'from' => 'hello@yourdomain.com',
'to' => 'friend@example.com',
'subject' => 'Hello World',
'html' => '<strong>It works.</strong>',
]),
CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($res);
package main
import (
"bytes"
"net/http"
"os"
)
func main() {
body := []byte(`{
"from":"hello@yourdomain.com",
"to":"friend@example.com",
"subject":"Hello World",
"html":"<strong>It works.</strong>"
}`)
req, _ := http.NewRequest("POST", "https://app.llamaemail.com/v1/emails", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("LLAMAEMAIL_API_KEY"))
req.Header.Set("Content-Type", "application/json")
http.DefaultClient.Do(req)
}
require 'net/http'
require 'json'
require 'securerandom'
uri = URI('https://app.llamaemail.com/v1/emails')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = "Bearer #{ENV['LLAMAEMAIL_API_KEY']}"
req['Content-Type'] = 'application/json'
req['Idempotency-Key'] = SecureRandom.uuid
req.body = {
from: 'hello@yourdomain.com',
to: 'friend@example.com',
subject: 'Hello World',
html: '<strong>It works.</strong>'
}.to_json
puts Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }.body
curl -X POST https://app.llamaemail.com/v1/emails \
-H "Authorization: Bearer $LLAMAEMAIL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"from": "hello@yourdomain.com",
"to": "friend@example.com",
"subject": "Hello World",
"html": "<strong>It works.</strong>"
}'
POST /v1/emails HTTP/1.1
Host: app.llamaemail.com
Authorization: Bearer le_live_…
Content-Type: application/json
Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000
{
"from": "hello@yourdomain.com",
"to": "friend@example.com",
"subject": "Hello World",
"html": "<strong>It works.</strong>"
}