Share via

I always get SmtpServerAuthenticationError when I use PlayFab API SendAccountRecoveryEmail in my Azure functions

Kim Strasser 2,536 Reputation points
2026-05-06T09:45:05.83+00:00

I don´t know why I´m getting the error because it always worked before. I have tested the API in two different Azure function projects. I use the same code in each function, the only difference is that I use AuthorizationLevel.Anonymous in one project and in the other project I use AuthorizationLevel.Function. In addition, I use another PlayFab title Id for the project with AuthorizationLevel.Anonymous. It´s the first time that I have tried to call the API with AuthorizationLevel.Function.

I get this error in PlayFab for both projects(AuthorizationLevel.Anonymous and AuthorizationLevel.Function) when I call my Azure function on my iPad Air:

"EventData": { "EventName": "sent_email", "EmailTemplateId": "...", "EmailTemplateName": "MyTemplate", "EmailTemplateType": "AccountRecovery", "Success": false, "ErrorName": "SmtpServerAuthenticationError", "ErrorMessage": "The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Authentication Required. For more information, go to", "EmailName": "Primary",

My Azure function where I call the API:

var request = new SendAccountRecoveryEmailRequest();
  request.EmailTemplateId = "...";
  request.Email = emailaddress;
  var resultsendemail = await adminAPI.SendAccountRecoveryEmailAsync(request);

In PlayFab the SMTP Addon is active and I have not changed the settings:

Screenshot 2026-05-06 114947

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.


Answer accepted by question author

  1. Pravallika KV 14,640 Reputation points Microsoft External Staff Moderator
    2026-05-06T09:47:51.19+00:00

    Hi @Kim Strasser ,

    Thanks for reaching out to Microsoft Q&A.

    It looks like your PlayFab call to SendAccountRecoveryEmail is reaching your SMTP server but failing with:

    “The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Authentication Required.”

    In most cases this means your SMTP provider (Exchange Online, Gmail, etc.) is blocking Basic Auth or your PlayFab SMTP add-on isn’t configured correctly.

    Go to https://myaccount.google.com/, Click "Security", enable Two-step Verification, once done, come back to the myaccount Security page, you will see "App passwords", open that, it will give you options for what you are trying to make a password for (a bunch of devices), select "Windows Computer", make a password, copy it, use this password in your code.

    Once you've turned on 2-step verification in your Google account, you need to use that 16-digit app-specific password in your PlayFab SMTP add-on instead of your normal Gmail password. Only an app password will let PlayFab authenticate to smtp.gmail.com when MFA is enabled on your account.

    Hope this helps!


    If the resolution was helpful, kindly take a moment to click on User's imageand click on Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Q&A Assist
    2026-05-06T09:45:20.9266667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The error is coming from the SMTP server used by PlayFab to send the account recovery email, not from the Azure Function authorization level or the PlayFab API call syntax.

    PlayFab’s SendAccountRecoveryEmail/SendAccountRecoveryEmailAsync only succeeds if:

    1. The PlayFab title is configured with a working SMTP server, and
    2. That SMTP server accepts authenticated, secure connections with the credentials and security settings configured in PlayFab.

    The error details:

    • ErrorName: SmtpServerAuthenticationError
    • ErrorMessage: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Authentication Required...

    This indicates the SMTP server is rejecting PlayFab’s attempt to send mail because either:

    • SSL/TLS is not enabled or not matching what the SMTP server requires, or
    • The username/password (or app password) configured for the SMTP server is no longer valid, or
    • The SMTP provider has tightened security (for example, now requiring SSL/TLS or app passwords instead of “less secure apps”).

    To fix this, update the SMTP configuration for each affected PlayFab title:

    1. Verify SMTP server requirements
      • Confirm with the SMTP provider which port, encryption, and authentication are required (for example, TLS on port 587, SSL on 465, or specific app passwords).
      • If using a provider like Gmail, ensure SSL is enabled and, if two-step verification is enabled, use an app password or enable access for less secure apps as required.
    2. Update PlayFab title SMTP configuration
      • In PlayFab Game Manager, open each title (both title IDs used by the two Azure Function projects).
      • Go to the email/SMTP configuration section used for sending emails.
      • Ensure:
        • SMTP host, port, and SSL/TLS settings match the provider’s current requirements.
        • SMTP username and password (or app password) are correct and not expired or revoked.
      • Save the updated configuration.
    3. Test email sending from PlayFab
      • Use PlayFab’s email features (for example, sending a test email or using the account recovery/email verification tutorials) to confirm that emails can be sent successfully from the title.
      • Check the player’s PlayStream events for sent_email with Success: true as described in the email tutorials.
    4. Retry the Azure Function
      • Once the SMTP configuration is fixed, the existing Azure Function code:
             var request = new SendAccountRecoveryEmailRequest();
             request.EmailTemplateId = "...";
             request.Email = emailaddress;
             var resultsendemail = await adminAPI.SendAccountRecoveryEmailAsync(request);
        
        does not need to change. The function authorization level (Anonymous vs Function) does not affect PlayFab’s ability to authenticate to the SMTP server.

    If the SMTP provider recently changed security policies (for example, requiring TLS 1.2 or disallowing non-SSL connections), ensure the PlayFab SMTP configuration is updated accordingly.


    References:

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.