Opened 3 years ago
Last modified 9 days ago
#58917 new defect (bug)
Email Sending validation doesn't occur when password reset is sent from the Users page
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Users | Keywords: | has-patch changes-requested |
| Focuses: | Cc: |
Description
Suppose my site isn't configured to send emails. So, when a user tries to reset his password from the public login page, he gets the below error.
This is expected, but now, if I log in as an admin account, navigate under the Users page, and try to send the reset link for that user, I can see no validation error. The email doesn't get sent in real, but I can't see the error that my site isn't configured for sending emails.
I think this type of behaviour is kind of confusing for users. We should show that validation error in the admin panel as well.
Change History (6)
This ticket was mentioned in PR #4921 on WordPress/wordpress-develop by @rajinsharwar.
3 years ago
#3
- Keywords has-patch added
#4
@
3 years ago
I am now storing a transient flag "reset_password_email_failure" when the email sending fails, and then we check for this transient on the Users page to display the error message. The transient is set to expire in 60 seconds to ensure that the error message is only shown once after the email sending failure.
#6
@
9 days ago
- Keywords changes-requested added; needs-testing removed
Patch Testing Report
Patch Tested: https://github.com/WordPress/wordpress-develop/pull/4921
Environment
- WordPress: 7.0-beta2-61752-src
- PHP: 8.2.29
- Server: nginx/1.29.4
- Database: mysqli (Server: 8.4.7 / Client: mysqlnd 8.2.29)
- Browser: Chrome 145.0.0.0
- OS: macOS
- Theme: Twenty Twenty-Five 1.4
- MU Plugins: None activated
- Plugins:
- Code Snippets 3.9.5
- Test Reports 1.2.1
Steps taken
- Add the following snippet to
functions.phpor viaCode Snippetsplugin to cause intentional email failure.
add_action( 'phpmailer_init', function( $phpmailer ) {
$phpmailer->isSMTP();
$phpmailer->Host = 'invalid.smtp.host';
$phpmailer->Port = 587;
});
- Use
/wp-login.php?action=lostpasswordto remind a password for a user - Confirm that the following message is displayed:
Error: The email could not be sent. Your site may not be correctly configured to send emails. Get support for resetting your password.
- In Dashboard Users > All Users page, click
Send password resetof any user - Confirm the following message is displayed:
Password reset links sent to 0 users.
- Apply the patch and test both
/wp-login.php?action=lostpasswordand dashboard password reminder screens - ❌ Patch is failing.
Expected result
- We expect to see the an error message displayed on the Users > All Users page similar to the one displayed on the login lost password screen.
Screenshots/Screencast with results
Error message on the /wp-login.php?action=lostpassword screen



Checking if Email Sending is possible, and showing appropriate admin notices when a password reset is requested from the Users page.
Trac ticket: https://core.trac.wordpress.org/ticket/58917