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
- Create a Compose application from the repository.
- Use the included
docker-compose.yml. - Add the variables above to the application environment.
- Configure the domain proxy to service
web, internal port80. - 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_EMAILbelongs 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.