{mail to=$email, template='order', subject='Order confirmation'} renders _mail/order.pad to the HTML part and _mail/order.txt to the text part - made from the HTML when there is no .txt - after running _mail/order.php, inside the _inits.pad/_exits.pad of that _mail/ with @page@. The template is looked up like a snippet, from the page's directory up to the application and _common.

As a pair without template= the rendered content is the HTML part - inside a loop with the fields of the row, one mail per occurrence. The tag shows nothing; the mail sees the page's variables and leaves them as they were. from= (default $padMailFrom), cc=, bcc= and replyTo= are the other headers.

$padMailTransport decides where the mail goes: 'file' (the default) writes an .eml under DATA/mail/<app>/, keeping the newest $padMailKeep - no mail server needed; 'mail' sends through PHP's mail(); the name of an application function gets the message array and answers whether it went. A line break in a header value, an address that is none, a missing subject or template are errors. From PHP: padMail ( $to, $template, $subject, $vars, $options ), and [ 'queue' => TRUE ] sends it through the job queue.

The tag sends mail, so its examples are shown, not run.