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.