Hi there,
I got same problem started sometime ago (this year Sept/Oct).
Find details below:
WP:5.8.2
PHP:7.4.26
WP Mail:3.2.1
Email: Other SMTP – gmail with App Password (gmail handles our domain for outgoing emails)- Settings: smtp.gmail.com, TLS, Auth ON
– Test emails are working fine, even I recreated a new password
– It is not all the time fails to send, but mostly. (WP Core succeed, WFence yes/no, WPBackup Fails)
– Did not reinstall yet the WP Mail
Error Event:
Content
Mailer: Other SMTP SMTP Error: Could not authenticate.
Source
Wordfence Security
/home/customer/www/ourdomain.com/public_html/wp-content/plugins/wordfence/lib/wordfenceClass.php (line: 7161)
wfConfig::set('lastEmailHash', time() . ':' . $hash);
foreach ($emails as $email) {
$uniqueContent = $content . "\n\n" . sprintf(/* translators: WordPress admin panel URL. */ __('No longer an administrator for this site? Click here to stop receiving security alerts: %s', 'wordfence'), wfUtils::getSiteBaseURL() . '?_wfsf=removeAlertEmail&jwt=' . wfUtils::generateJWT(array('email' => $email)));
wp_mail($email, $subject, $uniqueContent);
7161 line is the last
Other Error Event:
Content
Mailer: Other SMTP SMTP Error: Could not authenticate.
Source
BackWPup
/home/customer/www/ourdomain.com/public_html/wp-content/plugins/backwpup/inc/class-job.php (line: 1152)
if ( $bracket_pos === false || $at_pos === false ) {
$this->job['mailaddresssenderlog'] = str_replace( array(
'<',
'>',
),
'',
$this->job['mailaddresssenderlog'] ) . ' <' . get_bloginfo( 'admin_email' ) . '>';
}
$headers[] = 'From: ' . $this->job['mailaddresssenderlog'];
}
wp_mail( $this->job['mailaddresslog'], $subject, file_get_contents( $this->logfile ), $headers );
Last line
Debug event when WFence succeed:
Content
An email request was sent.
Source
Wordfence Security
/home/customer/www/ourdomain.com/public_html/wp-content/plugins/wordfence/lib/wfActivityReport.php (line: 508)
if (!wp_mail($email, sprintf(/* translators: 1. Site URL. 2. Localized date. */ __('Wordfence activity for %1$s on %2$s', 'wordfence'), date_i18n(get_option('date_format')), $shortSiteURL), $uniqueContent, 'Content-Type: text/html')) {
$success = false;