The sendform.php sends all sorts of HTML forms as mail.
Immediately after body tag the sendform.php loaded:
<?PHP include "includes/forms/sendform.php"; ?>
It will sent to itself in the action attribute.
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" /> |
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.
To prevent spam, a honeypot can be set anywhere in the form:
<?PHP
$honeypot_formid = 'DESIGNATION';
require_once($webutlercouple->config['server_path'].'/includes/forms/honeypot/index.php');
?>
The honeypot generates several hidden fields that are checked for manipulation after the form has been sent. The variable honeypot_formid must be given a different name / value in each form. This variable sets a different honeypot in each form, which is only valid in this form.
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'] : ''; ?>
" />
In config.php, the format of file attachments to be transferred can be restricted with the $forms_mailattachs variable. The key is equal to the name of the upload field, the value is the MIME type of the file. Example:
In the form: <input type="file" name="PDF" />
In the config.php: $forms_mailattachs['PDF'] = ' application/pdf';
For the upload field named 'PDF', only files with the MIME type 'application/pdf' are permitted.
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.
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.
If you want to send emails via SMTP, you can enter the access data in the file "/settings/smtp.php" register.