Issue
Cannot send emails using wordpress form or trying to send emails through wordpress form gives server error.
Possible cause
Elementor uses WordPress’ wp_mail function to send emails. Your web host takes the sent email, processes it, and sends it. This is where the issues happen mostly.
Web hosting servers may deactivate the PHP function responsible for email transmission, preventing the sending of emails. This is a precautionary measure implemented to prevent the misuse of the server for spamming purposes, ensuring that users do not utilise the hosting platform to send spam emails.
The wp_mail function uses the PHP send_mail function by default. But if it is disabled on that server, then email sending fails. To solve this, do either of the following:
- Contact your hosting service and request them to enable it.
- Use an SMTP server.
- Use a tool such as Site Mailer.
What is SMTP?
SMTP stands for “Simple Mail Transfer Protocol”. SMTP is an email server that routes your email in forms into the inbox of your listed customers. It is an external email server (for example, Gmail can be used as an SMTP server) that ensures your emails get delivered faster. It also helps to prevent your email from ending up in users’ spam folders.
Solution
Run a test on your WordPress site and see if it can send emails. This can help you investigate if there are any issues with the default PHP mail() function.
To confirm email deliverability:
- Install any SMTP plugin. For details, refer https://wordpress.org/plugins/wp-mail-smtp/
- Select a different SMTP server other than default (for example, SendGrid).
- Fill in the authorization details
- Send a test email.
If you send the email using a different SMTP server other than default but shows error with default SMTP then report this to the hosting service provider.
To fix this issue, try one or more of the following solutions:
- The form’s From email address needs to be from the same domain as your website. So if your site is example.com, then you should use the From email address as [email protected], or [email protected], or similar. You can use the Reply-To field to select the visitor’s email address for replying to the user’s request.
- Use the Elementor Form Submissions feature to check that the form is functioning properly. To learn more about Form Submissions click here.
- Use another email address (possibly your email is registered as spam). To avoid being marked as spam try changing the length (shorter or longer) of your email subject line.
- If you are using any third-party integrations, try disabling them. For example, MailChimp or ActiveCampaign. If this resolves your issue, then see the Elementor Academy for more information. Check the field mapping in your autoresponder account and the Form widget. Make sure that you do not have the required fields set to none in the Form Widget. Also, do not add an “address” field or a “birthday” field in the field mapping settings in your MailChimp account.
- If the page refreshes after submitting a form, this may be due to a plugin or a theme code conflict. In this case, deactivate all your plugins besides Elementor and Elementor Pro, and check if you can send the emails properly. If this didn’t work, switch to a default theme of WordPress and check if it solves the issue.
- Make sure that the ID in Form Fields (in the field’s Advanced tab) is populated. Follow these steps to do this:
- Login to WP Admin.
- Open the page with the form.
- On the form, click the edit icon. The Edit Form panel is displayed on the left.
- Under Form Fields, click the desired field.
- Click Advance.
- Enter ID and Shortcode.
- Use the correct shortcode as shown in the Advanced tab for each field within your email message box.
If the issue persists, submit a ticket and send us the following information:
- Your system info that you can find under Elementor > System Info in your WP Admin.
- The web server and PHP error logs. You can find them in your hosting panel or you can ask your hosting company for it.