You can't send email from an an ApplicationId or Service Principal, it needs to come from either a real user or a shared mailbox. If your using the client credentials flow https://video2.skills-academy.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow and you have assigned the Application permission for Mail.Send then your application can send a message using a user's or shared Maibox Sendmail endpoint eg
https://graph.microsoft.com/v1.0/users/shared@mailbox.com/sendMail