The site sends email for two things: form notifications (set up per form under Forms → Forms → Emails) and password resets. It sends through any SMTP server, configured in the environment:
| Variable | |
|---|---|
SMTP_HOST | The server. Without it nothing is sent: Payload writes each email to the server's console instead. |
SMTP_PORT | 587 (STARTTLS) by default; 465 uses TLS throughout. |
SMTP_USER, SMTP_PASS | The login, if the server needs one. |
SMTP_FROM | The sender address. Required when SMTP_HOST is set: the server refuses to start without it, rather than lose every message. |
SMTP_FROM_NAME | The sender's name. Defaults to "Website". |
Nothing here is specific to one provider. A transactional email service (one that gives you SMTP credentials) works, and so does your own mail server.
A public demo (DEMO_MODE) sends no email at all, whatever these say: see Live demo.
Form notifications #
Editors set up who gets an email for each form. Some details worth knowing:
- An email with no Email To goes to the
SMTP_FROMaddress. {{name}}in a subject or message is replaced by the answer to the field calledname;{{*:table}}lists every answer.- Submissions are stored whether or not the email is sent, so a notification that does not arrive loses nothing.
In development #
Leave SMTP_HOST empty. Emails, password resets included, are printed in the terminal that runs pnpm dev.