When we configure a contact form, WordPress uses PHP's mail () function by default to send emails. This function is blocked on our servers for security reasons and thus avoid spam.
What we must do is change these settings using SMTP with the help of an additional plugin. Here are the steps we must follow:
1. Login to WordPress Administrator
2. Check among the installed plugins, if there is a plugin for sending emails via SMTP. For example, if you have a plugin like "Contact form 7" and we don't see SMTP in the name, it is most likely that you need to install an additional plugin so that the sending of emails is done by SMTP
3. Install and activate the WP Mail SMTP by WPForms plugin
4. Once installed go to the plugin settings
5. In the Email Service section check the option Other SMTP
6. In SMTP Server write the name of the server, example: servername.lineadns.com
7. In Encryption we mark "SSL".
8. n SMTP Port 465 must be selected.
9. In SMTP Username the mail to be configured is placed (it must be previously created from the cPanel).
10. In SMTP Password we enter the one assigned to that email account.
11. Verify that all the information is correct and click on Save Settings
12. Once the changes are saved, we click on the Test Mail tab to verify that it works. In the Send To field, a personal email is entered that can be verified instantly. Ideally it is Gmail or Hotmail which are the most used