How to fix "550 5.3.5 Email sender's username is invalid" error when using Communication Services for SMTP application.

TatMap 0 Reputation points
2024-07-28T22:38:07.29+00:00

I was able to get very close to successfully setting up an application to send automated emails through my Microsoft account using the following article:

https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/email/send-email-smtp/smtp-authentication

I followed all of the steps but anytime it sends an email that email is rejected with the following error:

550 5.3.5 Email sender's username is invalid

From what I can tell, this is because the required username for this service (

Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
896 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pinaki Ghatak 4,610 Reputation points Microsoft Employee
    2024-07-29T07:06:59.2966667+00:00

    Hello @TatMap

    The 550 5.3.5 Email sender’s username is invalid error message is a response from the recipient’s mail server that signifies a failure in email delivery. This error can occur due to several reasons, including an invalid or non-existent recipient email address, or if your email is mistakenly identified as spam by the recipient’s mail server.

    In your case, it seems like the username for the SMTP service, which is supposed to be <Azure Communication Services Resource name>.<Entra Application ID>.<Entra Tenant ID>, is being rejected because it’s too long and doesn’t resemble a real email address. This could be causing the recipients’ mailboxes to identify it as spam.

    Here are a few potential solutions:

    Check the Username Format: Ensure that the username you’re using is in the correct format as specified by Azure Communication Services. Any deviation from the required format could result in errors.

    Use a Shorter Username: If possible, try to use a shorter username. Some mail servers may have restrictions on the length of the username.

    Use a Valid Email Address as the Username: If the service allows, you could try using a valid email address as the username. This might prevent the email from being identified as spam.

    Check the Recipient’s Mail Server: The issue could also be on the recipient’s side. Their mail server might have strict spam filters that are blocking your emails. You could ask the recipient to whitelist your email address.

    Use a Different SMTP Service: If none of the above solutions work, you might have to consider using a different SMTP service, such as smtp.office365.com with security defaults disabled, as you mentioned.

    Remember, it’s important to ensure that your application complies with all relevant email sending policies and practices to prevent it from being identified as spam. This includes things like using a valid return address, not sending unsolicited emails, and so on.


    I hope that this response has addressed your query and helped you overcome your challenges. If so, please mark this response as Answered. This will not only acknowledge our efforts, but also assist other community members who may be looking for similar solutions.

    0 comments No comments

Your answer

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