Getting started
Get your API key, add a domain and send your first email.
1. Get your API key
Create an API key for your sending domain in the dashboard. Keep the full key private and use it on your server as SENDHOG_API_KEY.
An API key is the private credential your application uses to access SendHog. New account? Add your domain in the next step first, then create a key with send-email permission, called email.send. The full key is shown only when you create it.
2. Add your domain
Add the domain you want to send from, such as example.com. SendHog gives you DNS entries—settings that prove you own the domain. Add them at the company that manages your DNS, then return to SendHog and click Check DNS. Sending is automatically approved when your domain is verified.
Choose your DNS provider for specific instructions:
Using another provider? Follow the general DNS steps. Leave the records that deliver your existing incoming mail, called MX records, unchanged.
3. Send your first email
An SDK is a code library that connects your app to SendHog. Choose SendHog if you are starting fresh, or choose your current provider for familiar sending methods. Replace sender@example.com with an address on your verified domain and recipient@example.net with your own inbox.
Set SENDHOG_API_KEY on your server to the full key you saved. Install the SDK with the command in the code box, then save and run the example.
import { SendHog } from '@sendhog/sdk';
const client = new SendHog(process.env.SENDHOG_API_KEY ?? '');
const { id } = await client.send({
"from": "sender@example.com",
"to": "recipient@example.net",
"subject": "Hello from SendHog",
"text": "Hello from your application."
});
console.log(id);npm install @sendhog/sdkimport { SendHog } from '@sendhog/sdk';
const client = new SendHog(process.env.SENDHOG_API_KEY ?? '');
const { id } = await client.send({
"from": "sender@example.com",
"to": "recipient@example.net",
"subject": "Hello from SendHog",
"text": "Hello from your application."
});
console.log(id);npm install @sendhog/sdkimport os
from sendhog import SendHog
client = SendHog(os.environ['SENDHOG_API_KEY'])
result = client.send({
"from": "sender@example.com",
"to": "recipient@example.net",
"subject": "Hello from SendHog",
"text": "Hello from your application."
})
print(result['id'])python -m pip install sendhog-sdk# Native SendHog HTTP; the SDK translates the SendHog call above.
curl 'https://app.sendhog.com/v1/send' \
-H "Authorization: Bearer $SENDHOG_API_KEY" \
-H 'Content-Type: application/json' \
--data '{
"from": "sender@example.com",
"to": [
"recipient@example.net"
],
"subject": "Hello from SendHog",
"text": "Hello from your application."
}'No SDK installation required.import { SESv2Client, SendEmailCommand } from '@sendhog/sdk/ses';
const apiKey = process.env.SENDHOG_API_KEY;
if (!apiKey) throw new Error('Set SENDHOG_API_KEY on your server.');
const client = new SESv2Client({ apiKey });
const result = await client.send(new SendEmailCommand({
"FromEmailAddress": "sender@example.com",
"Destination": {
"ToAddresses": [
"recipient@example.net"
]
},
"Content": {
"Simple": {
"Subject": {
"Data": "Hello from SendHog"
},
"Body": {
"Text": {
"Data": "Hello from your application."
}
}
}
}
}));
console.log(result.MessageId);npm install @sendhog/sdkimport { SESv2Client, SendEmailCommand } from '@sendhog/sdk/ses';
const apiKey = process.env.SENDHOG_API_KEY;
if (!apiKey) throw new Error('Set SENDHOG_API_KEY on your server.');
const client = new SESv2Client({ apiKey });
const result = await client.send(new SendEmailCommand({
"FromEmailAddress": "sender@example.com",
"Destination": {
"ToAddresses": [
"recipient@example.net"
]
},
"Content": {
"Simple": {
"Subject": {
"Data": "Hello from SendHog"
},
"Body": {
"Text": {
"Data": "Hello from your application."
}
}
}
}
}));
console.log(result.MessageId);npm install @sendhog/sdkimport os
from sendhog.ses import SESv2Client
client = SESv2Client(os.environ['SENDHOG_API_KEY'])
result = client.send_email(**{
"FromEmailAddress": "sender@example.com",
"Destination": {
"ToAddresses": [
"recipient@example.net"
]
},
"Content": {
"Simple": {
"Subject": {
"Data": "Hello from SendHog"
},
"Body": {
"Text": {
"Data": "Hello from your application."
}
}
}
}
})
print(result['MessageId'])python -m pip install sendhog-sdk# Native SendHog HTTP; the SDK translates the Amazon SES call above.
curl 'https://app.sendhog.com/v1/send' \
-H "Authorization: Bearer $SENDHOG_API_KEY" \
-H 'Content-Type: application/json' \
--data '{
"from": "sender@example.com",
"to": [
"recipient@example.net"
],
"subject": "Hello from SendHog",
"text": "Hello from your application."
}'No SDK installation required.import { ServerClient } from '@sendhog/sdk/postmark';
const apiKey = process.env.SENDHOG_API_KEY;
if (!apiKey) throw new Error('Set SENDHOG_API_KEY on your server.');
const client = new ServerClient({ apiKey });
const result = await client.sendEmail({
"From": "sender@example.com",
"To": "recipient@example.net",
"Subject": "Hello from SendHog",
"TextBody": "Hello from your application."
});
console.log(result.MessageID);npm install @sendhog/sdkimport { ServerClient } from '@sendhog/sdk/postmark';
const apiKey = process.env.SENDHOG_API_KEY;
if (!apiKey) throw new Error('Set SENDHOG_API_KEY on your server.');
const client = new ServerClient({ apiKey });
const result = await client.sendEmail({
"From": "sender@example.com",
"To": "recipient@example.net",
"Subject": "Hello from SendHog",
"TextBody": "Hello from your application."
});
console.log(result.MessageID);npm install @sendhog/sdkimport os
from sendhog.postmark import ServerClient
import asyncio
async def main():
async with ServerClient(os.environ['SENDHOG_API_KEY']) as client:
result = await client.outbound.send({
"sender": "sender@example.com",
"to": "recipient@example.net",
"subject": "Hello from SendHog",
"text_body": "Hello from your application."
})
print(result.message_id)
asyncio.run(main())python -m pip install sendhog-sdk# Native SendHog HTTP; the SDK translates the Postmark call above.
curl 'https://app.sendhog.com/v1/send' \
-H "Authorization: Bearer $SENDHOG_API_KEY" \
-H 'Content-Type: application/json' \
--data '{
"from": "sender@example.com",
"to": [
"recipient@example.net"
],
"subject": "Hello from SendHog",
"text": "Hello from your application."
}'No SDK installation required.import { Resend } from '@sendhog/sdk/resend';
const apiKey = process.env.SENDHOG_API_KEY;
if (!apiKey) throw new Error('Set SENDHOG_API_KEY on your server.');
const client = new Resend({ apiKey });
const { data, error } = await client.emails.send({
"from": "sender@example.com",
"to": [
"recipient@example.net"
],
"subject": "Hello from SendHog",
"text": "Hello from your application."
});
if (error) throw new Error(error.message);
console.log(data.id);npm install @sendhog/sdkimport { Resend } from '@sendhog/sdk/resend';
const apiKey = process.env.SENDHOG_API_KEY;
if (!apiKey) throw new Error('Set SENDHOG_API_KEY on your server.');
const client = new Resend({ apiKey });
const { data, error } = await client.emails.send({
"from": "sender@example.com",
"to": [
"recipient@example.net"
],
"subject": "Hello from SendHog",
"text": "Hello from your application."
});
if (error) throw new Error(error.message);
console.log(data.id);npm install @sendhog/sdkimport os
from sendhog.resend import Resend
client = Resend(os.environ['SENDHOG_API_KEY'])
result = client.Emails.send({
"from": "sender@example.com",
"to": [
"recipient@example.net"
],
"subject": "Hello from SendHog",
"text": "Hello from your application."
})
print(result['id'])python -m pip install sendhog-sdk# Native SendHog HTTP; the SDK translates the Resend call above.
curl 'https://app.sendhog.com/v1/send' \
-H "Authorization: Bearer $SENDHOG_API_KEY" \
-H 'Content-Type: application/json' \
--data '{
"from": "sender@example.com",
"to": [
"recipient@example.net"
],
"subject": "Hello from SendHog",
"text": "Hello from your application."
}'No SDK installation required.import { SendGridClient } from '@sendhog/sdk/sendgrid';
const apiKey = process.env.SENDHOG_API_KEY;
if (!apiKey) throw new Error('Set SENDHOG_API_KEY on your server.');
const client = new SendGridClient({ apiKey });
const [response] = await client.send({
"from": "sender@example.com",
"to": "recipient@example.net",
"subject": "Hello from SendHog",
"text": "Hello from your application."
});
console.log(response.headers['x-message-id']);npm install @sendhog/sdkimport { SendGridClient } from '@sendhog/sdk/sendgrid';
const apiKey = process.env.SENDHOG_API_KEY;
if (!apiKey) throw new Error('Set SENDHOG_API_KEY on your server.');
const client = new SendGridClient({ apiKey });
const [response] = await client.send({
"from": "sender@example.com",
"to": "recipient@example.net",
"subject": "Hello from SendHog",
"text": "Hello from your application."
});
console.log(response.headers['x-message-id']);npm install @sendhog/sdkimport os
from sendhog.sendgrid import SendGridAPIClient
client = SendGridAPIClient(os.environ['SENDHOG_API_KEY'])
response = client.send({
"from": {
"email": "sender@example.com"
},
"personalizations": [
{
"to": [
{
"email": "recipient@example.net"
}
]
}
],
"subject": "Hello from SendHog",
"content": [
{
"type": "text/plain",
"value": "Hello from your application."
}
]
})
print(response.headers['x-message-id'])python -m pip install sendhog-sdk# Native SendHog HTTP; the SDK translates the SendGrid call above.
curl 'https://app.sendhog.com/v1/send' \
-H "Authorization: Bearer $SENDHOG_API_KEY" \
-H 'Content-Type: application/json' \
--data '{
"from": "sender@example.com",
"to": [
"recipient@example.net"
],
"subject": "Hello from SendHog",
"text": "Hello from your application."
}'No SDK installation required.Save as send.mjs and run node send.mjs.
With Node.js 22.18 or newer, save as send.mts and run node send.mts.
Save as send.py and run python send.py in the same environment used for installation.
Run the edited cURL command in the terminal where you set SENDHOG_API_KEY. No SDK is needed.
JavaScript and TypeScript use npm install @sendhog/sdk (Node.js 22+). Python uses python -m pip install sendhog-sdk from PyPI (Python 3.11+). No local SendHog checkout is needed. See SDK installation for details.
4. Check your email
A successful send returns a message ID. Check your recipient inbox for the email, or find the message in your dashboard’s email log. An ID means the request was accepted, not that the email has arrived.
Open email log