The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Use an Astro Action to accept and validate a contact form, then call Resend’s SDK from server-side code to send the message. The handler must run on demand, so configure an appropriate Astro adapter for your deployment; a static page alone cannot execute the email-sending code.
Choose Astro Actions or an API route
Resend documents both approaches for Astro. An Action is a good fit for a form-oriented workflow: Astro parses named fields, can validate them with a Zod schema, and returns data or an error that the page can use for feedback. An API route gives you an explicit POST endpoint and request/response handling. Choose based on how you want to structure the server-side interface; the documentation establishes functional differences, not a performance advantage for either option.
Astro Actions are available from Astro 4.15 according to Astro’s guide. Check the current guide and your project’s version before implementing them.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Configure server-side execution and the Resend key
Both approaches require server-side execution at submission time. Astro’s HTML form recipe lists a server adapter as a prerequisite, and the Actions guide requires on-demand rendering for the direct HTML form-action pattern. Set up the adapter and deployment configuration that match your hosting environment; the exact steps vary by deployment.
#1 Best Overall
- Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM)
- Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
- CanaKit Turbine Black Case for the Raspberry Pi 5
- CanaKit Low Noise Bearing System Fan
- Mega Heat Sink - Black Anodized
Store the Resend API key in a server-side environment variable named RESEND_API_KEY. Resend’s Astro example initializes its SDK using import.meta.env.RESEND_API_KEY. Do not put the key in browser JavaScript or otherwise expose it to visitors.
Build the form submission path
For a concise, typed form workflow, define an Action that accepts form data, validates the submitted fields, and sends an email through Resend. The form inputs need name attributes so Astro can parse them. Use a server-side schema to check every value before using it in an email; browser-side validation is useful for convenience, but is not a substitute.
Rank #2
- Includes Raspberry Pi 4 4GB Model B with 1.5GHz 64-bit quad-core CPU (4GB RAM)
- Includes Pre-Loaded 32GB EVO+ Micro SD Card (Class 10), USB MicroSD Card Reader
- CanaKit Premium High-Gloss Raspberry Pi 4 Case with Integrated Fan Mount, CanaKit Low Noise Bearing System Fan
- CanaKit 3.5A USB-C Raspberry Pi 4 Power Supply (US Plug) with Noise Filter, Set of Heat Sinks, Display Cable - 6 foot (Supports up to 4K60p)
- CanaKit USB-C PiSwitch (On/Off Power Switch for Raspberry Pi 4)
- Define the Action. Astro’s documented pattern uses
defineAction(), setsaccept: 'form', and supplies an input schema. - Validate the submission. Check required fields and constrain their values on the server before constructing the message.
- Send through Resend. Create the Resend client in server-side code using the environment variable, then call
resend.emails.send()with the sender, recipient, subject, and message content. - Connect the form. Submit named fields to the Action. Astro also documents direct standard HTML form submission, which can work without client-side JavaScript when the page is configured for on-demand rendering.
Resend’s example uses Acme <onboarding@resend.dev> as a sample sender. Treat it as illustrative: the example does not establish which sender address or domain is configured for your production account.
Show success and validation or delivery errors
An Action returns either data or an error. Use that result in the page to tell the visitor whether the submission succeeded or needs correction, and avoid reporting success before the send operation has returned successfully. Astro’s guide also documents redirecting after success. Keep the feedback useful without displaying secrets or unnecessary internal error details.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.When to use an API route instead
Choose an API route when you prefer a distinct POST endpoint and explicit request/response handling. Read the submitted form data in the route, validate it on the server, then call Resend with the validated values. As with an Action, the endpoint needs an on-demand server runtime and the API key must remain server-side.
Astro’s form recipes cover these paths: Build forms with API routes and Build HTML forms in Astro pages. For the Resend-specific SDK integration patterns, see Send emails with Astro; for Action setup and form submissions, see Astro Actions.
Quick Recap
Best Value
- Includes Raspberry Pi 5 16GB with 2.4Ghz 64-bit quad-core CPU (16GB RAM)
- Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
- CanaKit Turbine Black Case for the Raspberry Pi 5
- CanaKit Low Noise Bearing System Fan
- Mega Heat Sink - Black Anodized
Rank #4
- Broadcom BCM2711, quad-core Cortex-A72 (ARM v8) 64-bit SoC @ 1. 5GHz
- 2. 4 GHz and 5. 0 GHz IEEE 802. 11b/g/n/ac wireless LAN, Bluetooth 5. 0, BLE
- 2 × USB 3. 0 ports, 2 x USB 2. 0 Ports
- 2 × micro HDMI ports supproting up to 4Kp60 video resolution
- Micro SD card slot for loading operating system and data storage
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

