I have a Magento 2.2.1 Running on a Amazon Lightsail VPS (the Bitnami Magento stack).
It has been working just fine, an previously I would get a "Password reset information" e-mail from the system whenever I tried to change the password of a user.
Now, however, if I try to set a new password, the page just reloads with an "Unable to send mail" error message being displayed at the top.
I'm using the SMTP App for Magento 2 plugin to handle mail, and when I go to Stores > Configuration > Advanced > System and test the mail set-up I successfully receive an e-mail from the system.
I have also verified that the e-mail addresses of the user accounts I am trying to reset the password for are valid.
UPDATE, I'm pasting the code from my _sendMail() function below.
public function _sendMail()
{
set_error_handler(array($this, '_handleMailErrors'));
$result = mail(
$this->recipients,
$this->_mail->getSubject(),
$this->body,
$this->header);
restore_error_handler();
if ($this->_errstr !== null || !$result) {
/**
* @see Zend_Mail_Transport_Exception
*/
#require_once 'Zend/Mail/Transport/Exception.php';
throw new Zend_Mail_Transport_Exception('Unable to send mail. ' . $this->_errstr);
}
}