{mailform:to:subject:html:body:ok:lang:from}

Description

Emits an HTML form that, when a visitor submits it, sends an e-mail. The form posts via AJAX to mail.php, so no mail is sent at page render - only when someone submits it. Arguments in order: to (recipient address, required), subject, html (the form body markup, required), body (an optional message template; the placeholder is replaced with the collected field values, otherwise the body is just those values), ok (the confirmation text shown after submit), lang, and from. With no recipient the submit is aborted and nothing is sent.

Parameters

to required default (empty)

Recipient address. One email like reports@example.org, or a JSON array of addresses ["a@x.org","b@x.org"]. If empty, mail.php aborts and nothing is sent.

subject optional default (empty)

Subject line of the email that gets sent on submit.

html required default (empty)

The visible form fields, as literal HTML, inserted verbatim inside the form (e.g. Your note <input name="note">). Each named input becomes a labelled block in the email body. Without inputs the form has nothing to collect and mail.php aborts on submit.

body optional default (collected answers only)

Email message template. The placeholder 99d05d65418d4145d43f84e83545193e-e5e89709e848a8de4b6c5785fb44d899-b35aa550b269d04c552945f73530918b-158fe886d667c999dd71dff485a6d549-082f4f83d1876cec4749a538bc73bab3-6bfa9b961d4bd7b63768c4c8c29eee86-57cedcc87af16588744150a43655d021 is replaced with all submitted fields, each rendered as a name/value block. If left empty, the email body is just those collected answers.

ok optional default (empty)

Confirmation text shown to the visitor after a successful send (echoed back by mail.php and swapped into the form area).

lang optional default (install default)

Language/charset for the sent email (e.g. utf-8). Controls the mail encoding, not the form display.

from optional default (install default sender)

Sender address put on the email, e.g. actionapps@example.org or a Name <addr@example.org> form.

Examples

virtual{mailform:office@example.org:Note from the site:Your note <input name="note">:A visitor wrote:<br>_#1<br>Regards<br>The website:Thanks, your note was sent.:utf-8:web@example.org}
Expected(a form with a "note" input; the email body uses the template, with the placeholder swapped for the submitted fields)
Actual
Your note
body is a template; the placeholder _#1 is replaced with all submitted fields (here, the note input as a name/value block). After sending, the ok text "Thanks, your note was sent." replaces the form.
virtual{mailform:office@example.org:Website message:Your message <input name="message">:::utf-8:web@example.org}
Expected(a form with a "message" input; on submit emails the answer to office@example.org)
Actual
Your message
The smallest useful form: one input named message, sent to office@example.org with subject Website message. body is left empty, so the email is just the submitted answer. On submit the visitor sees nothing extra (ok is empty).
virtual{mailform:["office@example.org","desk@example.org"]:Shared inbox:Subject <input name="subject"><br>Body <textarea name="body"></textarea>:::utf-8:web@example.org}
Expected(a form whose submission is emailed to both office@ and desk@example.org)
Actual
Subject
Body
to accepts a JSON array of addresses, so the same submission reaches several recipients. The bracketed list passes through untouched because { and [ next to a quote are not command tokens.
virtual{mailform:::Your note <input name="note">::::}
Expected(a form renders, but submitting it sends nothing because to is empty)
Actual
Your note
mailform always renders a form, even with empty arguments - there is no render-time guard. But with an empty to, mail.php aborts on submit and no mail is sent. Always supply a recipient.
virtual{mailform:office@example.org:Contact request:Name <input name="name"><br>Email <input name="reply"><br>Message <textarea name="message"></textarea><br><button>Send</button>:New contact request:<br>_#1:Sent. We will reply soon.:utf-8:web@example.org}
Expected(a 3-field contact form; on submit emails all three fields to office@example.org)
Actual
Name
Email
Message
html can hold any number of inputs plus a submit button. Every named field (name, reply, message) is collected and appears in the email where _#1 sits, each as its own name/value block.