Transports

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.

PathCallReturnsWire into
Mail APInew HostingerTransport({ token, mailbox })TransportcreateMailer
SMTPHostingerTransport({ user, pass })SMTPConfigcreateSMTPMailer

Official references: Hostinger API, Mail API, SMTP ports.

Mail API

OptionTypeDefault or requirement
tokenstringrequired — Agentic Mail API token (shown once)
mailboxstringrequired — mailbox resource ID, e.g. AC1a2b3c4d5e6f7g
baseUrlstringhttps://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 folder

Features

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 optionHostinger fieldNotes
from namedisplayNameAddress is the managed mailbox
to / cc / bccto / cc / bccEmail arrays
subjectsubject
text / htmltext / htmlEither or both
attachmentsattachmentsBase64 content, optional contentType / cid
messageIdKept on SendResult (API returns empty body)
replyTo / headers / priorityNot supported on the Mail API

SMTP

Ready Hostinger relay settings — no host/port guesswork. Pass HostingerTransport({ user, pass }) straight into createSMTPMailer.

SettingValue
Hostsmtp.hostinger.com
Port 465SSL/TLS on connect — default
Port 587STARTTLS
UsernameFull mailbox address
PasswordMailbox 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):

OptionTypeDefault
userstringrequired — full mailbox address
passstringrequired — mailbox password
port465 | 587465
poolbooleanunset
maxConnectionsnumberunset (SMTP default 5 when pooled)

hostingerSmtpConfig(...) still works as a 1.x compatibility alias for the same options.

Mail API vs SMTP

NeedPrefer
Agentic Mail token / mailbox resource IDMail API
Reply / forward by IMAP UIDMail API (sendReply / sendForward)
replyTo, custom headers, priority, DKIMSMTP
Existing SMTP client / form stackSMTP
Sent-folder copy via Hostinger’s APIMail API (automatic)

Troubleshooting

Contact & resources

ResourceLink
Developers portaldevelopers.hostinger.com
Mail API referenceapi.mail.hostinger.com
SMTP ports tutorialhostinger.com/tutorials/smtp-port
Business email producthostinger.com/business-email
hPanelEmails → domain → Agentic Mail / Configuration settings

Learn more

Next

On this page