Hello,
I searched the forum and I do not see any error like the one that appears in NAV.
I have configured my Office365 account on the SMTP page and when I push send test emails button and send it to the same email address that i configured, no error appears. But if I push the test button again and send it to other address I get the error that I attached below (5.2.0 STOREDRV.Submission.Exception: SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Can not submit message).

Other times I solved the error by changing the Office365's password account for a new one, but I do not know if this temporary solution is correct or we need to configure something else.
Can we do something else?
Thanks for everything.
Answers
Open it as an Administrator and use the following command Does it work?
which version are you using?
On NAV2016 when you click Test Email Setup (SMTP Mail Setup) I believe the FromAddress and the SenderAddress are the same which it doesn't make any sense and then generates the error message that you sent. You could confirm it using the debugger.
On NAV2018 the message is different. Only asks for the SenderAddress which makes more sense. Because it will pick up FromAddress from the SMTP Mail Setup
Choose the email address that should receive a test email message: