Send HTML Form per Mail

The sendform.php sends all sorts of HTML forms as mail.

Structure of the form page

Immediately after body tag the sendform.php loaded:

<?PHP include "includes/forms/sendform.php"; ?>

Forms are created using the following template:

It will sent to itself in the action attribute.

<form method="post" action="index.php?page=_PAGENAME_">
Name:* <input type="text" name="Name" required="required" />
eMail:* <input type="email" name="eMail" required="required" />
Comment:*   <textarea rows="5" name="Comment" required="required"></textarea>
  <input type="hidden" name="sendto" value="1" />
  <input type="submit" name="sendform" value="Send" />
</form>

Both name and value of an input field will be sent, so the name should therefore be chosen accordingly. The HTML5 attributes "required" and "placeholder" are supported in the editor.

The text field someone has to be present, it is used as the sender field of shipping and the submit button must have the name "sendform" so that the mail will be sent. With the hidden field "sendto" can be sent to different recipients various forms.

Multiple options can be passed as an array. Example:

<input type="checkbox" name="Order[]" value="Catalog" />
<input type="checkbox" name="Order[]" value="Brochure" />

If sending occurs an error, the transmitted data can be reissued with echo $_POST['_FIELDNAME_']; inside value. Example:

<input type="text" name="Interests" value="
<?PHP echo isset($_POST['Interests']) ? $_POST['Interests'] : ''; ?>
" />

Templates for mail delivery

In the directory /tpls are 2 templates: usermail.tpl for sending a confirmation email to the visitor and adminmail.tpl for the mail to website operator.
For each receiver ID from the "sendto" field can separate templates with the file name usermail_ID.tpl or adminmail_ID.tpl be created, eg usermail_2.tpl for ID 2. If there are no ID templates, the standard template will be used.

Send pictures using the mail

In the config.php different images can be stored for mail delivery. The image files must be exist in the directory /imgs. The key of the variable $forms_mailimages is used as the key of the template variable $mailcontent. The keys are freely selectable.