Compose Email is giving an error message

Compose Email is giving an error message

The compose email feature in the CRM contacts module is giving me an error after I change the 'from address' to a different email other than the user's primary email.

The error message:
{
    "code": "INTERNAL_ERROR",
    "details": {},
    "message": "javax.mail.MessagingException: 5.2.252 SendAsDenied; user@domain.com not allowed to send as user@anotherdomain.com; STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message [BeginDiagnosticData]Cannot submit message. 0.35250:AE480000, 1.36674:0A000000, 1.61250:00000000, 1.45378:02000000, 1.44866:48230000, 1.36674:0E000000, 1.61250:00000000, 1.45378:4D230000, 1.44866:1E010000, 16.55847:C1130000, 17.43559:0000000024020000000000000000000000000000, 20.52176:140F9F961B00103100000000, 20.50032:140F9F968B17000000000000, 0.53414:140F9F96, 0.35180:FD010000, 255.23226:140F9F96, 255.27962:0A000000, 255.27962:0E000000, 255.31418:19000000, 0.35250:1F001336, 1.36674:0A000000, 1.61250:00000000, 1.45378:02000000, 1.44866:30000000, 1.36674:32000000, 1.61250:00000000, 1.45378:35000000, 1.44866:01000000, 16.55847:AB000000, 17.43559:0000000008040000000000000F00000000000000, 20.52176:140F9F961B00101064000000, 20.50032:140F9F968B170000D3020000, 0.53414:69000000, 0.35180:0A001380, 255.23226:38030000, 255.27962:0A000000, 255.27962:32000000, 255.17082:DC040000, 0.27745:73000000, 4.21921:DC040000, 255.27962:FA000000, 255.1494:78000000, 0.38698:86000000, 1.41134:46000000, 0.37692:1F000000, 0.44092:86000000, 0.41232:86000000, 0.60208:1F000000, 0.37136:86000000, 0.34608:02000000, 0.55056:86000000, 0.42768:86000000, 0.56112:02000000, 0.52807:30000000, 1.41134:46000000, 7.36354:010000000000010932373A42, 4.33016:DC040000, 7.40748:010000000000010B372D3933, 7.57132:00000000000000002D356433, 4.39640:DC040000, 1.63016:32000000, 8.45434:4A39964F0A08EA4F9ACAA0899C88351D39303332, 1.46798:04000000, 5.10786:0000000031352E32302E353739312E3032373A425935505231334D42333031363A63356165623564372D393361312D346532632D613563662D3564333735376333353935383A3331393134303A2E4E4554204672616D65776F726B20342E382E393033322E30001013000000, 7.51330:26C993CB26C4DA0800000000, 0.39570:13000000, 1.55954:0A000000, 0.49266:04000000, 1.33010:0A000000, 2.54258:00000000, 0.40002:00000000, 1.56562:00000000, 1.33010:0A000000, 2.54258:00000000, 0.40002:00000000, 1.56562:00000000, 1.64146:32000000, 1.33010:32000000, 2.54258:DC040000, 1.33010:32000000, 2.54258:DC040000, 255.1750:7C060000, 255.31418:D7000000, 0.22753:0B00F410, 255.21817:DC040000, 0.64418:E0000000, 4.39842:DC040000, 0.41586:86060000, 4.60547:DC040000, 0.21966:02019866, 4.30158:DC040000[EndDiagnosticData] [Hostname=BY5PR13MB3016.namprd13.prod.outlook.com]",
    "status": "error"
}