Skip to content
67hosting

How to send email from your app via API

Updated · 4 min read

In short

To send email from your app, connect and verify your domain in the “Email” section, create an API token under “Profile and API tokens”, and send a POST request to https://app.host67.com/api/v1/email/send with from, to, subject and html or text. DKIM and SPF are applied automatically. The limit is 30 emails a day on Free and 500 on Pro.

Transactional emails are the ones your app sends on its own: a confirmation code, a password reset, an order notification, a receipt. On 67hosting you can send them from your own domain with a single HTTP request — no separate email service needed.

Step 1. Verify the sender domain

You can only send from a domain that's connected to email in your account and verified. How to do it is in the guide on email on your own domain: add the DNS records and click “Check DNS”.

Once verified, messages are signed with DKIM automatically and pass SPF checks, so mail providers are less likely to send them to spam.

For a quick test you can send from the free *.host67.com address, with limits: up to 50 emails a day, no more than 5 recipients per message, and a “test address” note at the bottom. For real mail, connect your own domain.

Step 2. Create an API token

  1. In the dashboard, open “Profile and API tokens”.
  2. In the “API tokens” section, enter a name — for example, my-app — and click “Create token”.
  3. Copy the token right away: it's shown only once. Tokens start with h67_.

Keep the token in your app's environment variables, not in the code. If it leaks, delete it in your profile and create a new one.

Step 3. Send an email

curl -X POST https://app.host67.com/api/v1/email/send \
  -H "Authorization: Bearer h67_your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "Company <hello@mysite.com>",
    "to": ["client@example.com"],
    "subject": "Order #1234 confirmed",
    "html": "<p>Thanks for your order!</p>"
  }'

The response is {"id": "…"}, meaning the mail server has accepted the message for delivery.

Request fields:

FieldRequiredWhat it is
fromyesSender: hello@mysite.com or Name <hello@mysite.com>
toyesRecipient — a string or an array of addresses
subjectyesSubject line
html, textat least oneMessage body as HTML and/or plain text
cc, bccnoCopy and blind copy
reply_tonoReply-to address
attachmentsnoAttachments: filename and content in base64

Limits and errors

FreePro
Emails per day30500

The counter resets at the start of each day in UTC. Usage is shown on the “Plan and balance” page.

If something is wrong, the API returns an error with a readable message in the error field:

CodeReason
401Missing or invalid token
403The sender domain isn't connected or verified
400A required field is missing or malformed
429Daily sending limit reached

Retrying after a network error can send a duplicate: the API doesn't track repeats of the same request. If that matters, check the result before retrying.

Sending from an AI agent

If you've connected 67hosting to an AI agent over MCP, the agent has a send_email tool with the same fields. Just ask: “send an email from hello@mysite.com to …”. How to connect an agent is in the guide on publishing with an AI agent.

FAQ

Can I send newsletters through this API?

The API is meant for transactional email — confirmations, notifications, receipts — and is limited to 30 emails a day on Free and 500 on Pro. It isn't suitable for bulk marketing campaigns.

Why do I get a 403 error?

The domain in the from field isn't connected to email in your account or isn't verified yet. Open your site's “Domain and email” → “Email”, check the DNS records and click “Check DNS”.

Will my emails land in spam?

After the domain is verified, messages are signed with DKIM and pass SPF, which greatly lowers the risk of landing in spam. Content matters too: avoid image-only emails and suspicious links.

Can I attach a file?

Yes. Pass an attachments array where each file has a filename and content — the file data encoded in base64.

Try it on your own site

Free, no card: a site on a *.host67.com address with SSL in a couple of minutes.

Start for free

More guides