WordPress cannot send emails because it is caused by a blog space. You can use the following method to check whether the email is sent. Create a php file named mail. php. Open the file and enter the following code:
The code is as follows: |
Copy code |
<? Php $ Txt = "hello "; // Change the email address below to yours $ Mail = 'Somebody @ example.com '; // Send an email Mail ($ mail, "My subject", $ txt ); Echo 'message was sent! '; ?> |
Save and upload the file to the root directory of your website and run the following command in your browser:
Http: // your blog URL/mail. php
Check your email in your mailbox. If you receive an email titled My subject, your space supports mail () function, which is the default WordPress mail sending method. If you have not received any emails, it means that your website space does not support mail (), which is why WordPress cannot send emails. Please contact our customer service in your blog space.
Method 2 (only one plug-in is recommended here): WP Mail SMTP
The usage is simple. Download, install, activate, and set the settings as shown in the following figure:
If the test is true, it means we can successfully send and receive emails.