• Resolved babouz44

    (@babouz44)


    Hello !

    Like for some others, we tried to configure an Outlook/Office365 smtp and we get errors… but all seems to be well configured. In the connexion details all is good.

    But when we tried to submit a test we get an “Forbiden” error :

    { “code”: 422, “message”: “Forbidden”, “errors”: null }

    So I looked in my host logs and I get these error :
    Got error ‘PHP message: PHP Warning: Undefined array key “access_token” in /home/clients/xxxxx/xxxxx/wp-content/plugins/fluent-smtp/app/Services/Mailer/Providers/Outlook/Handler.php on line 174’, referer https://www.xxxx.com/wp-admin/options-general.php?page=fluent-mail

    One more things, when we click the link to get the token in fluentsmtp, we are redirect to the refreshtoken and in the window the token always start with “1. xxx”
    It seems a bit weird for a token…

    Hope someone could help us !

Viewing 1 replies (of 1 total)
  • Plugin Support Ariful Islam

    (@arifulislam1)

    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:

    1. 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.
    2. 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:

    1. Delete the current Microsoft/Outlook connection in FluentSMTP and create it again.
    2. 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
    3. Make sure you pasted the Client Secret Value, not the Secret ID.
    4. Make sure the redirect URL in Microsoft exactly matches the FluentSMTP callback URL:
      https://yourdomain.com/wp-json/fluent-smtp/outlook_callback
    5. Please confirm the Microsoft account has an active Exchange Online mailbox/license.
    6. 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.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.