Wiki › Component

Contact form (chaipat.cc)

Article
From Chaipat's knowledge graph

The contact form, api/mail.js, is the server side of the site's Mail page: a serverless function on Vercel that saves a message and forwards it to his inbox through the Resend email API, with the sender as the reply-to address.

It sends no confirmation to the sender, because that would let anyone use the form to send mail to any address. Spam is kept out by a hidden field that bots fill in and by a limit of five messages an hour from one address. Messages are also kept in the database, so none is lost if forwarding fails.