Ariful Islam
Forum Replies Created
-
Hi @jathang ,
The important detail here is that the
422you see in FluentSMTP’s MS365 logs/reports is currently a FluentSMTP wrapper code, not always the original HTTP status returned by Microsoft Graph. In the Outlook/Office365 handler, FluentSMTP sends through Microsoft Graph’s/me/sendMailendpoint, but if the Graph call or token refresh fails, the plugin re-logs that failure asWP_Error(422, ...). So the more useful clue is usually the message text beside it, such asUnauthorized,Forbidden, orNot Found, rather than the422itself.Also, FluentSMTP’s Summary/Reporting email does not create a new Microsoft-side error on its own. It simply reads the existing email logs and reports messages that were already logged as failed.
Since Microsoft Graph should return
202 Acceptedon a successfulsendMailrequest, seeing422in FluentSMTP usually means we need to inspect the exact failed log entry to find the real cause behind it.Could you please share the full Server Response / Technical Details from one failed email log, and also confirm these 4 points?
- Does this happen for all emails, or only for emails sent by a specific plugin/form/workflow?
- Is the site multilingual (WPML/Polylang)?
- Is the sender a licensed mailbox, an alias, or a shared mailbox?
- In Azure/Entra, are the redirect URI and mailbox permissions set exactly for the sender in use?
If the message is
UnauthorizedorForbidden, the most common causes are redirect URI mismatch, token/auth issues, or mailbox/send-as permission issues on the Microsoft side.Hi @awr10e ,
The
422 Unauthorizedresponse with Microsoft 365 usually means the Microsoft app/token is no longer being accepted, even if the connection was working previously. Since your logs show this started around July 15, 2026, I’d recommend checking the Microsoft app configuration first.Please go through these points:
- Make sure the email address set as the
From Emailin FluentSMTP is the same Microsoft 365 account used to authorize the connection. - In your Azure/Entra app, confirm the Redirect URI exactly matches the callback URL shown in FluentSMTP.
- Verify the required Microsoft Graph permissions are still present and admin consent is granted.
- Confirm the mailbox is active and properly licensed in Microsoft 365.
- Remove the current Microsoft connection from FluentSMTP, then reconnect it once after verifying the above.
If the issue remains, please share:
- a screenshot of the FluentSMTP Microsoft connection settings
- a screenshot of the Azure/Entra app
AuthenticationandAPI permissionssections
That will help us narrow it down further. Also, I will mark the topic as not resolved until resolved.
Thank you.
Hello @babouz44 ,
The 422 here is usually FluentSMTP’s wrapper around a Microsoft Graph send error. In our Outlook mailer, FluentSMTP sends through Microsoft Graph me/sendMail, so the mailbox behind the Microsoft login/token is the mailbox that actually needs permission to send.
A couple of important notes here:
- The value starting with 1. after clicking “Authenticate with Office365 & Get Access Code” is not necessarily wrong. That step returns an authorization code, not the final bearer access token. FluentSMTP then exchanges that code for the real access/refresh tokens when you save the connection.
- The PHP warning about Undefined array key “access_token” suggests the token exchange or token refresh did not return a normal token payload, so FluentSMTP ended up without a valid usable access token.
Please try the following from scratch:
- Delete the current Microsoft/Outlook connection in FluentSMTP and create it again.
- Use the same mailbox for all three steps:
- the FluentSMTP “From Email”
- the Microsoft/Entra app registration/auth flow
- the Microsoft account used when authorizing the connection
- Make sure you pasted the Client Secret Value, not the Secret ID.
- Make sure the redirect URL in Microsoft exactly matches the FluentSMTP callback URL:
https://yourdomain.com/wp-json/fluent-smtp/outlook_callback - Please confirm the Microsoft account has an active Exchange Online mailbox/license.
- If this is a shared mailbox, the authenticated user also needs the proper Exchange permission such as Send As or Send on behalf, and Microsoft-side permission to send from that mailbox.
Thank you.
Hi @alexqbox ,
Apologies for the delayed reply. Thanks for sharing the screenshot.
The browser console error is only a side effect of the real problem: the FluentSMTP test-email AJAX request is returning an HTTP 500 from
wp-admin/admin-ajax.php.From our side, expected Outlook / Office 365 mailer errors should normally come back as a JSON response, so a raw 500 usually means one of these is happening before FluentSMTP can return its normal error message:
- a PHP fatal error on the site
- a plugin/theme conflict during the
wp_mail()request - a server-level security rule such as ModSecurity/WAF blocking the request
Could you please do the following and share the result?
- Enable WordPress debug logging, reproduce the issue once, and send us the exact lines written to
/wp-content/debug.logat the time of the failed test. - If
debug.logstays empty, please ask your host to check the server error log / ModSecurity log for that same request. - Please also confirm whether the site is multilingual (WPML/Polylang or language-prefixed URLs). If yes, that is especially relevant for Microsoft 365 because Microsoft requires the redirect URI to match exactly, and multilingual callback URLs are a known source of Outlook authorization issues.
As an Office 365 sanity check, please also verify:
- the token was generated with the same mailbox that is used as the sender address
- the mailbox has an active Microsoft 365 license
- the Azure app has the required Microsoft Graph delegated permissions and admin consent
Once you share the debug/server log entry, we can usually pinpoint the exact cause very quickly.
Thank you
Hi @technicalx ,
Apologies for the delayed reply.
It looks like the PDO and PDO_MYSQL PHP extensions are missing on your server. In that case, FluentSMTP may fail before it can return a proper AJAX error response, which can make the “Send Test Email” button appear to hang.
So, you can ensure that the pdo and pdo_mysql PHP extensions are enabled on your server. On many hosting providers, this can be done through cPanel or Plesk, or by contacting your hosting provider and asking them to enable these extensions.
Once they are enabled, FluentSMTP should be able to use its logging and database layer normally.
I’ll also share this with our development team so they can review the behavior and make any improvements if needed.
Thank you.
Hi @shanekryme ,
Apologies for the delay in replying. For FluentSMTP, you should not choose Single tenant for this setup.
Instead, we recommend selecting Any Entra ID tenant + Personal Microsoft accounts. This is Microsoft’s current wording for what was previously called the Multitenant + Personal Microsoft accounts option.
FluentSMTP’s Microsoft mailer currently uses Microsoft’s
/commonOAuth endpoints, so it is designed to work with a multitenant-style app registration rather than a tenant-specific (single-tenant) application.If you’re only using a Microsoft 365 work or school mailbox, Any Entra ID tenant may also work. However, Single tenant is not the recommended option for FluentSMTP’s default Outlook/Microsoft 365 connection flow.
Also, please make sure the following settings are configured correctly:
- Platform: Web
- Redirect URI:
https://yourdomain.com/wp-json/fluent-smtp/outlook_callback
If authentication still fails after making these changes, please share the exact error message or a screenshot, and we’ll be happy to guide you further.
Thank you.
Hi @awr10e ,
Sorry you’re running into this.
The
422 Unauthorizedhere is usually coming from the Microsoft auth/token validation step, not from theDisable Encryptionoption. The Outlook / Microsoft 365 connection in FluentSMTP uses Microsoft Graph API, so SMTP encryption settings generally won’t affect this part.Since the emails stopped on July 15, 2026 and re-authentication is also failing now, the first thing I’d check is the Microsoft app registration:
- In Microsoft Entra / Azure > App registrations > Certificates & secrets, confirm the client secret is still valid and that you copied the Client Secret Value, not the Secret ID.
- In Authentication, make sure the Redirect URI exactly matches the callback URL shown in FluentSMTP, for example:
https://yourdomain.com/wp-json/fluent-smtp/outlook_callback - Please confirm you are authenticating with the same Microsoft 365 mailbox that is set as the sender / From email in FluentSMTP.
- Make sure the app is still enabled and the required Microsoft Graph permissions are granted.
After checking those, please disconnect/reconnect the Microsoft connection, generate a fresh auth code, save it again, and test once more.
If it still returns
422, please share the full Microsoft/AADSTS error you see during the auth step or a screenshot from the browser network response. That will help us tell whether this is a secret expiry, redirect URI mismatch, or tenant permission issue.Thank you.
Hi @lyk-1 ,
Thanks for sharing this. You’re right:ses:ListIdentitiesis not required by Amazon SES for sending emails.
In the current FluentSMTP SES setup, we use that permission during connection setup to fetch SES identities and show helper information such as available sender emails / verified domain details. However, the actual mail delivery path uses SESSendRawEmail, and AWS itself validates the sender identity when the message is sent. So for runtime email delivery, a send-only policy is the right least-privilege direction.
Also,ListIdentitiesmay expose SES identity information from the AWS account, and it should not be a hard requirement for users who only want FluentSMTP to send WordPress emails.
For the current version, you may need to grantses:ListIdentitiestemporarily while saving the SES connection, then remove it afterward and keepses:SendRawEmail/ses:SendEmailfor sending. Some dashboard helper details, sender discovery, or quota/identity information may not be available without read/list permissions, but sending should work with the send permission.
We agree this can be improved. We’ll treatListIdentitiesand related read permissions as diagnostics instead of mandatory setup requirements, and we’ll review the AWS guide so users can choose a least-privilege send-only policy instead of broad full-access permissions.
Thanks again for the thoughtful report.Hi @albertoarias ,
You can use a shared Office 365 mailbox as the sender address, but not by logging in directly as that shared mailbox.
Since shared mailboxes normally don’t have a usable password and Microsoft recommends keeping their sign-in blocked, FluentSMTP cannot authenticate directly with the shared mailbox account. Instead, please configure the Outlook/Office 365 API connection using a regular licensed Microsoft 365 user account, then grant that user permission to send from the shared mailbox.
Recommended setup:
- In Microsoft 365/Exchange Admin, grant the authenticated user
Send Aspermission for the shared mailbox. UseSend on behalfonly if you are okay with recipients seeing “sent on behalf of”. - In FluentSMTP, choose the Outlook/Office 365 mailer.
- Set the From Email to the shared mailbox address.
- During authentication, sign in with the licensed user account, not the shared mailbox.
- Re-authenticate after permissions are added, then send a test email.
If they are using the “OtherSMTP” option with
smtp.office365.com, that will not work for a passwordless shared mailbox because SMTP AUTH requires an account that can authenticate.If they still get a send error like
ErrorSendAsDenied, it usually means the Microsoft 365 user used during authentication does not yet haveSend As/Send on behalfpermission for that shared mailbox, or the permission has not propagated yet.Thank you.
Hi @puregraphx ,
This error means FluentSMTP can reach the SMTP server, but PHP/OpenSSL is rejecting the SMTP server’s SSL/TLS certificate during the encrypted handshake:
stream_socket_enable_crypto(): certificate verify failedSo this is not a password/authentication failure. It usually happens when the SMTP server certificate is expired, self-signed, missing an intermediate certificate, issued for a different hostname, or when the VPS has an outdated CA certificate bundle.
Because all FluentSMTP sites on the same VPS started failing at the same time, the most likely causes are:
- The mail server’s SSL certificate expired or was renewed incorrectly.
- The SMTP hostname in FluentSMTP does not match the certificate name. For example, using
mail.domain.comwhile the certificate is only valid forserver.hostname.com. - The mail server is not serving the full certificate chain.
- The VPS/PHP CA bundle is outdated.
- FluentSMTP is using TLS/STARTTLS while PostSMTP is using a different setting or bypassing SSL verification.
Please ask the VPS/mail server admin to test the SMTP certificate from the server:
openssl s_client -starttls smtp -connect SMTP_HOST:587 -servername SMTP_HOST -verify_return_error -showcertsFor SSL port 465:
openssl s_client -connect SMTP_HOST:465 -servername SMTP_HOST -verify_return_error -showcertsThey should check the certificate expiry date, subject/SAN hostname, issuer chain, and final verify result. The fix is to install/renew a valid certificate for the exact SMTP hostname, serve the full chain, and update the server CA bundle if needed. Also make sure the FluentSMTP settings use the correct pair: TLS with port
587, or SSL with port465.As a temporary diagnostic only, if the connection is set to “None” encryption and Auto TLS is enabled, disabling Auto TLS may confirm that the issue is with STARTTLS certificate verification. We do not recommend using that as a permanent fix if SMTP authentication is enabled, because credentials/email may be sent without proper TLS protection.
Thank you.
Hi @khanhvo ,
From FluentSMTP’s side, there is no daily optimization/health-check routine that resets SendGrid or falls back permanently to PHP Mailer.
FluentSMTP’s daily cron hook is
fluentmail_do_daily_scheduled_tasks, and it only handles email-log cleanup and the optional email digest. It does not update or delete connection settings. SendGrid timeouts/failures also do not remove the connection; they are logged, and if a fallback connection is configured, FluentSMTP may try that for the failed send only.The settings are stored in one WordPress option:
fluentmail-settingsSo if the SendGrid connection disappears after midnight, the most likely causes are:
- That option row is being overwritten/deleted by a backup, sync, staging/live deployment, security cleanup, or DB restore process.
- Redis/object cache is serving an old copy of that option after a cache flush/rebuild.
- WordPress auth salts changed, breaking decryption of the stored API key. This would normally make the connection invalid, not delete it.
Best next steps:
- Right after saving SendGrid, export/check
wp_options.option_name = 'fluentmail-settings'. - Check it again immediately after midnight.
- If the DB row changed, something external is overwriting the option.
- If the DB row is still correct but FluentSMTP shows PHP Mailer, flush Redis/object cache and recheck.
You can also add temporary logging around
updated_option,added_option, anddeleted_optionforfluentmail-settingsto capture the exact request/cron/user that changes it.Thank you.
Hi @macpheeweb ,
The reason this may happen is that the Email Logs search currently searches only the main log fields: recipient, sender, and subject.
With Contact Form 7, the visitor/customer name or email might not get stored as the actual email recipient or sender. Instead, it is commonly included inside the email body, or sometimes in the Reply-To header. That’s why you can open the log and see the customer details in the message, but a regular search for that name or email may not return the corresponding log entry.
As a workaround, if the customer name or email appears in the message body, you can try searching using:body:customer@email.comor:body:Customer Name. This tells FluentSMTP to search specifically within the email body.
Your suggestion about adding a Name / Email column is a good one. At the moment, FluentSMTP does not store a separate customer name or email field because it logs outgoing WordPress emails in a generic way, and each form plugin structures those fields differently.
However, I’ve shared your suggestion as a feature request with our product team. Hopefully, it will be considered in future updates.
Thank you.