Initialization |
-- |
- Replace the form action URL
action="themekit/scripts/contact-form/contact-form.php" with your URL.
- Set the attribute
data-email="example@domain.com" and insert the recipent's email.
|
SMTP |
-- |
To use your SMTP server for sending the emails open the file themekit\scripts\contact-form\phpmailer\config.php and edit the server informations with your ones.
After the config.php file has been configured you need to add the attribute data-engine="smtp" to the component.
Ex: <form action="" data-engine="smtp"> ... </form> . The SMTP method allow you to send also HTML emails. If email sengin fails check the browser's console for errors.
This feature is provided by PHPMailer.
|
Form options |
Attribute |
action="contact-form.php" |
Make sure this setting link to the contact-form.php file of your website. |
data-email="example@domain.com" |
Set the recipeint's email. You can set it also by edit the file themekit/scripts/contact-form/contact-form.php. |
data-subject="" |
Set the recipeint's email subject. |
|
Input types |
HTML |
Text |
<input type="text" class="input-text" id="" name="" placeholder=""> |
Email |
<input type="email" class="input-text" id="" name="" placeholder=""> |
Select |
<select class="input-select" id="" name=""><option value="">Option</option></select> |
Textarea |
<textarea class="input-textarea" id="" name="" placeholder=""></textarea> |
Date picker |
<input type="text" data-toggle="datepicker" autocomplete="off" class="input-text" name="" id=""> |
|
Required field |
Attribute |
To set a field as required add the attribute required to the input item.
|
Inline form |
CSS |
Add the class form-inline to the form component to set the horizontal layout.
|
Checkbox validation |
HTML |
To add a checkbox validation that force the user to check it before submitting the message add the following code just above the send button.
<div class="form-checkbox">
<input type="checkbox" id="check" name="check" value="check" required>
<label for="check">Text</label>
</div>
|
Captcha |
-- |
- Go to www.google.com/recaptcha/ and click the get reCaptcha button to get the key. Only reCaptcha V3 is supported.
- Add the script
<script id="recaptcha" src="https://www.google.com/recaptcha/api.js?render=[YOUR-KEY-HERE]"></script> to your html page, into the footer, and replace [YOUR-KEY-HERE] with your public site key.
- Edit the file
themekit/scripts/contact-form/contact-form.php and find the variable $grecaptcha_secret_key = '[YOUR-KEY-HERE]'; , replace [YOUR-KEY-HERE] with your secret key.
|
Problems? |
-- |
- Send the email to a professional email service like Gmail or Microsoft, don't use hosting emails @yourdomain.
-
Check that your hosting support the email service by download the file
sendmail.php, open it and insert your email, upload it to your root site folder,
then open it from the browser (ex. www.your-site.com/sendmail.php). When you open the page you must receive the message Success, message sent and receive the email, if not your hosting don't support the emails.
- Use the SMTP feature.
|