Hi @Wencong Cui,
From the error message it seems Django Website is using basic authentication for SMTP instead of Oauth, which by default is blocked by the security defaults in Azure.
Please refer to this link to disable Azure security defaults and see if it can help with this issue:
If the issue persists, please refer to this link to check other possible causes like conditional access policy:
Error: Authentication unsuccessful
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.