Set up a contact form 7 on Wordpress
es:Configurar un formulario de contacto en WordPress en:Set up a contact form 7 on Wordpress fr:Mettre en place un formulaire de contact sur Wordpress it:Imposta un modulo di Contact Form 7 su WordPress
Introduction
You will see in this article how to set up a contact form on Wordpress.
We will use the following plugins:
- Contact Form 7 : https://wordpress.org/plugins/contact-form-7/
- WP Mail SMTP : https://wordpress.org/plugins/wp-mail-smtp/
Installation contact form 7 Wordpress
Everything will happen through the Wordpress admin page, sign in to your Wordpress admin page.
Go to "Plugins" and click on "Add New" :
Search for "Contact Form 7" and click on "Install Now" :
Do exactly the same thing for the "WP Mail SMTP" plugin
Then go to "Plugins" and activate the plugins that we just installed via the "Activate" button:
Configuration Contact Form 7
We will initially configure the plugin "Contact Form 7" which will be used to layout the form. To do this, go to "Contact" and click on "Add new"
Here you can define the form you want:
For more information about the syntax and the different fields available, we invite you to follow this link : https://contactform7.com/editing-form-template/
Here, the part that interests us the most is the tab "Mail", in the field "To" you can define to which email address the email will be sent:
Once your form is configured, go all the way down and save via the "Save" button The interface will then return you a code like this:
[contact-form-7 id="10" title="My Form"]
This code will be put on a Wordpress page that must be created or in a page that you already have.
The form will then be displayed:
The form is created, it remains only to configure the sending of mail via the plugin "WP Mail SMTP".
Configuration WP Mail SMTP
Go to "Settings"> "WP Mail SMTP":
Here is the configuration to perform:
- From Email: Enter your email address this one will be used for sending mail (this mailbox must exist)
- From Name: Indicate by which name will be sent the mail
- Mailer: Choose "Other SMTP"
- SMTP Host: ndicate your mail server so if my domain name is toto.com : mail.toto.com
- Encryption: None
- SMTP Port: 25
- Authentication: ON
- SMTP Username: your email
- SMTP Password: the password of your email address
You then have the possibility to test an email sending via "Email Test":
Once done sending mail via your form should work without problems
Security
For reasons of security, it is 'highly recommended' to set up a "captcha anti-robot" it will allow as the name suggests to avoid robots spamming your form and therefore your mailbox .
For that you have to create a public and secret key with google: https://contactform7.com/recaptcha/ (This requires a Google account however) and follow the procedure:
Copy the key pair into the WordPress admin screen of the site you have saved.
- Go to the menu Admin Contact> Integration.
- Find the reCAPTCHA panel and click Configure Keys.
- Copy the site key and secret key into the fields and save them.
- Finally, place a reCAPTCHA tag ([recaptcha]) in the content of your contact form.