Hostinger
Send email from a Hostinger mailbox through the Mail API or ready SMTP config.
Hostinger Email gives you a branded mailbox. Wire it into sently two ways — the Mail API over HTTPS, or the SMTP relay with Hostinger defaults already filled in.
The one rule
One name, two shapes: new HostingerTransport({ token, mailbox }) → createMailer (Mail API); HostingerTransport({ user, pass }) → createSMTPMailer (SMTP, no new).
IntelliSense narrows options and the return type by config shape. Vendor extras (listMailboxes, sendReply, sendForward) stay on the Mail API instance — never on the channel sender.
| Path | Call | Returns | Wire into |
|---|---|---|---|
| Mail API | new HostingerTransport({ token, mailbox }) | Transport | createMailer |
| SMTP | HostingerTransport({ user, pass }) | SMTPConfig | createSMTPMailer |
Official references: Hostinger API, Mail API, SMTP ports.
Mail API
| Option | Type | Default or requirement |
|---|---|---|
token | string | required — Agentic Mail API token (shown once) |
mailbox | string | required — mailbox resource ID, e.g. AC1a2b3c4d5e6f7g |
baseUrl | string | https://api.mail.hostinger.com |
The API sends from the managed mailbox. from only contributes the sender display name. A copy is saved to the Sent folder on every successful send (204 No Content).
Setup
In hPanel open Emails → your domain → Agentic Mail → API access, create a token scoped to the mailbox, and copy it — it is shown only once.
import { HostingerTransport } from "sently/transports/hostinger";
const hostinger = new HostingerTransport({
token: process.env.HOSTINGER_API_TOKEN!,
mailbox: "AC_placeholder", // replaced after listMailboxes()
});
const mailboxes = await hostinger.listMailboxes();
// [{ resourceId: "AC1a2b3c4d5e6f7g", address: "you@yourdomain.com" }]import { createMailer } from "sently/mailer";
import { HostingerTransport } from "sently/transports/hostinger";
const hostinger = new HostingerTransport({
token: process.env.HOSTINGER_API_TOKEN!,
mailbox: process.env.HOSTINGER_MAILBOX_ID!,
});
const mailer = await createMailer({ transport: hostinger });
const result = await mailer.send({
from: "Acme <you@yourdomain.com>",
to: "person@example.com",
subject: "Hello",
text: "Sent through the Hostinger Mail API",
});
console.log(result.response); // Message sent and saved to the Sent folderFeatures
Pick a branch. Channel send goes through mailer; extras stay on hostinger.
Transactional email via the channel mailer.
await mailer.send({
from: "you@yourdomain.com",
to: "person@example.com",
subject: "Order confirmed",
text: "Thanks for your order.",
});At least one of to, cc, or bcc must be present. There is no batch endpoint — sendBulk sends one by one.
Mail options mapping
| Mail option | Hostinger field | Notes |
|---|---|---|
from name | displayName | Address is the managed mailbox |
to / cc / bcc | to / cc / bcc | Email arrays |
subject | subject | |
text / html | text / html | Either or both |
attachments | attachments | Base64 content, optional contentType / cid |
messageId | — | Kept on SendResult (API returns empty body) |
replyTo / headers / priority | — | Not supported on the Mail API |
SMTP
Ready Hostinger relay settings — no host/port guesswork. Pass HostingerTransport({ user, pass }) straight into createSMTPMailer.
| Setting | Value |
|---|---|
| Host | smtp.hostinger.com |
Port 465 | SSL/TLS on connect — default |
Port 587 | STARTTLS |
| Username | Full mailbox address |
| Password | Mailbox password from hPanel |
Hostinger supports ports 465 and 587 only — not 2525 (SMTP ports guide).
Setup
Emails → your domain → Configuration settings → Manual Configuration — take the outgoing server host, port, and mailbox password.
import { createSMTPMailer } from "sently/smtp";
import { HostingerTransport } from "sently/transports/hostinger";
const mailer = await createSMTPMailer(
HostingerTransport({
user: "you@yourdomain.com",
pass: process.env.HOSTINGER_SMTP_PASSWORD!,
}),
);await mailer.send({
from: "you@yourdomain.com",
to: "person@example.com",
subject: "Hello",
text: "Sent through Hostinger SMTP",
});Features
Default — implicit TLS on connect.
const mailer = await createSMTPMailer(
HostingerTransport({
user: "you@yourdomain.com",
pass: process.env.HOSTINGER_SMTP_PASSWORD!,
// port: 465, // default
}),
);Exports: HOSTINGER_SMTP_HOST, HOSTINGER_SMTP_PORT_SSL (465).
SMTP options
Options for HostingerTransport({ user, pass }) (the SMTP overload):
| Option | Type | Default |
|---|---|---|
user | string | required — full mailbox address |
pass | string | required — mailbox password |
port | 465 | 587 | 465 |
pool | boolean | unset |
maxConnections | number | unset (SMTP default 5 when pooled) |
hostingerSmtpConfig(...) still works as a 1.x compatibility alias for the same options.
Mail API vs SMTP
| Need | Prefer |
|---|---|
| Agentic Mail token / mailbox resource ID | Mail API |
| Reply / forward by IMAP UID | Mail API (sendReply / sendForward) |
replyTo, custom headers, priority, DKIM | SMTP |
| Existing SMTP client / form stack | SMTP |
| Sent-folder copy via Hostinger’s API | Mail API (automatic) |
Troubleshooting
The Mail API token is wrong or revoked. Create a fresh token under Agentic Mail → API access; tokens are shown only once.
The mailbox resource ID is outside the token's scope. Open the Mailboxes branch (listMailboxes) or recreate the token with access to that mailbox.
At least one of to, cc, or bcc must be present. The error's params map names the fields that failed. Reply and Forward are mutually exclusive.
Hostinger’s upstream mail service returned an unexpected response. Retry with a Retry decorator, or fall back to SMTP.
Username must be the full mailbox address. Copy the password from hPanel → Configuration settings → Manual Configuration. Use port 465 (secure: true) or 587 only.
No. Use the matching sently channel sender; open a feature branch above for vendor extras on the transport.
Contact & resources
| Resource | Link |
|---|---|
| Developers portal | developers.hostinger.com |
| Mail API reference | api.mail.hostinger.com |
| SMTP ports tutorial | hostinger.com/tutorials/smtp-port |
| Business email product | hostinger.com/business-email |
| hPanel | Emails → domain → Agentic Mail / Configuration settings |
Learn more
- Email channel — mailer options and send pipeline
- SMTP — relay pooling, DKIM, adapters
- Retry — wrap any transport on 429 / 5xx
- Support matrix — Supported vs Available