Skip to content

Form fields

letterpost stores and forwards every field your form sends. A few names have a special meaning.

The email field

Every submission needs exactly one field named email:

  • It must be present and not empty.
  • It must be sent once, not as a list of values.
  • It must be a valid address whose domain can receive mail. A typo like gmail.con is rejected.

letterpost uses the address as the Reply-To of the mail it sends you, so you can answer the person directly.

<input type="email" name="email" required>

A submission without a valid email is rejected with the error code invalid (see Errors and redirects).

Control fields

Fields whose name starts with _ control letterpost. They are not stored and do not appear in the mail.

Field What it does
_subject The subject of the mail. One line, at most 100 characters. Without it, the subject is "New submission: " and the form's name.
_redirect A path to send the browser to after a successful submission, for example /thanks. It is placed on the website of the form's redirect URL, so a redirect URL must be set in the form's settings.
_redirect_error A path to send the browser to when the submission is rejected. letterpost adds the error code as ?error=<code>. Also needs a redirect URL.
<input type="hidden" name="_subject" value="New enquiry from the website">
<input type="hidden" name="_redirect" value="/thanks">
<input type="hidden" name="_redirect_error" value="/contact">

Without a redirect URL

If the form has no redirect URL in its settings, the browser lands on letterpost's thank-you page after sending, and on letterpost's error page when something goes wrong. A submission with _redirect but without a redirect URL is rejected; _redirect_error is ignored.

The redirect URL is the Redirect setting on the form's Delivery settings page.

Some other names starting with _ are kept for later use. Don't use your own fields with a leading _, except for the honeypot field.

Limits

  • At most 25 fields per submission, not counting control fields.
  • At most 128 KB per request.
  • File uploads are not supported. File fields in a multipart/form-data form are ignored.

The honeypot field

If you set a honeypot field in the form's settings (under Security), every submission must contain that field, and it must be empty. Its name starts with _, like the control fields, so it is never stored. See Spam protection.