Here are some common email errors and associated troubleshooting steps.
The server response was: 5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message.
Error cause and solution
This mail error appears to be caused by a mismatch between the sending email address and the from email address. This is causing office 365 to reject the email from being sent. To fix this issue ensure that both emails match exactly.