Skip to content
Siete y Medio Group Siete y Medio Group

Contact Form Setup: Hostinger SMTP and Dokploy

Configure Astro Rocket's contact form with a Hostinger mailbox, SMTP credentials, and a Dokploy Docker Compose deployment.

H

Hans Martens

2 min read
Table of contents Show Hide

Astro Rocket’s contact form validates submissions, filters bots with a honeypot, escapes user content, and sends the notification through SMTP. This guide uses a Hostinger mailbox and Dokploy, but the same environment variables work with any SMTP-compatible provider.

The contact form is separate from the optional newsletter integration. Resend is not required for contact messages.

What you need

  • A mailbox created in Hostinger, such as contact@yourdomain.com
  • The mailbox password
  • The address that should receive submissions
  • A Dokploy Compose application connected to this repository

Hostinger’s standard SMTP settings are:

Variable Value
SMTP_HOST smtp.hostinger.com
SMTP_PORT 465
SMTP_SECURE true
SMTP_USER Your Hostinger mailbox
SMTP_PASSWORD Your Hostinger mailbox password

Configure the environment

Add these variables to Dokploy’s application environment:

SITE_URL=https://yourdomain.com

SMTP_HOST=smtp.hostinger.com
SMTP_PORT=465
SMTP_SECURE=true
SMTP_USER=contact@yourdomain.com
SMTP_PASSWORD=your-hostinger-password
CONTACT_FROM_EMAIL=contact@yourdomain.com
CONTACT_TO_EMAIL=inbox@yourdomain.com

CONTACT_FROM_EMAIL is optional and defaults to SMTP_USER. Keep the password in Dokploy’s environment settings; never commit it to .env or the repository.

The contact form remains disabled until SMTP_USER, SMTP_PASSWORD, and CONTACT_TO_EMAIL are present. This prevents visitors from filling out a form that cannot deliver anything.

Deploy with Dokploy

  1. Create a Compose application from the repository.
  2. Use the included docker-compose.yml.
  3. Add the variables above to the application environment.
  4. Configure the domain proxy to service web, internal port 80.
  5. Deploy or redeploy after saving the environment.

The compose file exposes port 80 only on Dokploy’s internal Docker network. It does not publish a host port, so it can coexist with other services that use port `80).

Test delivery

Open the contact page, submit a valid message, and confirm that it arrives at CONTACT_TO_EMAIL. The visitor’s address is used as Reply-To, so you can reply directly from your Hostinger inbox.

If delivery fails, check:

  • The mailbox username and password are correct.
  • CONTACT_FROM_EMAIL belongs to the authenticated Hostinger mailbox or its allowed aliases.
  • The Dokploy container can make outbound TCP connections to smtp.hostinger.com:465.
  • The application was redeployed after environment variables changed.

Newsletter is separate

If the newsletter is enabled in src/config/site.config.ts, it still uses Resend’s audience API. Configure RESEND_API_KEY and RESEND_AUDIENCE_ID only for that feature. Those variables are not used by the contact form.

Share:

Related Posts

Updating Without Losing Your Content

Astro Rocket is installed with git clone, so updating is a git merge rather than an npm install. Here's the safe, reversible way to do it.

H Hans Martens
6 min read
#astro-rocket #tutorial #git #maintenance

Going Multilingual with Native i18n

How the opt-in i18n works: locale routing, the t()/tData() dictionary, an auto-localized blog, projects and pages, and how to ship a multilingual site.

H Hans Martens
14 min read
#astro-rocket #i18n #internationalization #tutorial

System, Light, Dark: How Colour Mode Works

A 3-state colour mode with no flash, live OS-preference tracking, and a pill dropdown that respects what the user picked. Here is how it is built.

H Hans Martens
5 min read
#astro-rocket #dark-mode #design-system #ux #tutorial

Ready to build?

Clone Astro Rocket, pick a theme, and launch your next project in minutes.