Errors with Microsoft Office 365 email

Hi all, I am getting this error when trying to send from ERPNext with Office 365 SMTP.

Does anybody know what it means?

(554, b’5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message. 0.35250:02017D86, 1.36674:0A000000, 1.61250:00000000, 1.45378:02000000, 1.44866:5C430000, 1.36674:0E000000, 1.61250:00000000, 1.45378:61430000, 1.44866:44010000, 16.55847:2E1D0000, 17.43559:0000000024020000000000000000000000000000, 20.52176:140F138B1000103100000000, 20.50032:140F138B8017000000000000, 0.35180:140F138B, 255.23226:0A002C8A, 255.27962:0A000000, 255.27962:0E000000, 255.31418:0201348A, 0.35250:0A000000, 1.36674:0A000000, 1.61250:00000000, 1.45378:02000000, 1.44866:46000000, 1.36674:32000000, 1.61250:00000000, 1.45378:4B000000, 1.44866:01000000, 16.55847:B2000000, 17.43559:00000000B0030000000000000100000000000000, 20.52176:140F138B1000101053000000, 20.50032:140F138B801700000F240000, 0.35180:58000000, 255.23226:4800D13D, 255.27962:0A000000, 255.27962:32000000, 255.17082:DC040000, 0.27745:19240000, 4.21921:DC040000, 255.27962:FA000000, 255.1494:4A240000, 0.38698:00000000, 0.37692:01000000, 0.44092:20000100, 0.41232:20000100, 0.60208:20000100, 0.37136:20000100, 0.34608:20000100, 0.55056:20000100, 0.42768:20000100, 0.56112:20000100, 0.52807:20000100, 7.36354:010000000000010920000100, 4.33016:DC040000, 7.40748:010000000000010B20000100, 7.57132:0000000000000000FE40ED2E, 1.63016:32000000, 4.39640:DC040000, 8.45434:41D11875E850074B83D94AA22CD7E47131363A53, 5.10786:0000000031352E32302E323833352E3031363A535932505230314D42323432373A66613865326262372D653363632D343763352D383762642D32323464346333333261643500001000000000, 7.51330:B09BC293A7CBD70802000000, 0.39570:00000000, 1.55954:0A000000, 0.48754:82000000, 0.40818:00000000, 0.56946:9C000000, 1.33010:0A000000, 2.54258:00000000, 0.40002:00000000, 1.56562:00000000, 1.64146:32000000, 1.33010:32000000, 2.54258:DC040000, 255.1750:52260000, 255.31418:BE000000, 0.22753:0A006136, 255.21817:DC040000, 0.64418:C3000000, 4.39842:DC040000, 0.41586:081B0000, 4.60547:DC040000, 0.21966:03000336, 4.30158:DC040000 [Hostname=SY2PR01MB2427.ausprd01.prod.outlook.com]‘)
Traceback (most recent call last):
File “/home/frappeuser/frappe-bench/apps/frappe/frappe/email/queue.py”, line 415, in send_one
smtpserver.sess.sendmail(email.sender, recipient.recipient, message)
File “/usr/lib/python3.6/smtplib.py”, line 888, in sendmail
raise SMTPDataError(code, resp)
smtplib.SMTPDataError: (554, b’5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message. 0.35250:02017D86, 1.36674:0A000000, 1.61250:00000000, 1.45378:02000000, 1.44866:5C430000, 1.36674:0E000000, 1.61250:00000000, 1.45378:61430000, 1.44866:44010000, 16.55847:2E1D0000, 17.43559:0000000024020000000000000000000000000000, 20.52176:140F138B1000103100000000, 20.50032:140F138B8017000000000000, 0.35180:140F138B, 255.23226:0A002C8A, 255.27962:0A000000, 255.27962:0E000000, 255.31418:0201348A, 0.35250:0A000000, 1.36674:0A000000, 1.61250:00000000, 1.45378:02000000, 1.44866:46000000, 1.36674:32000000, 1.61250:00000000, 1.45378:4B000000, 1.44866:01000000, 16.55847:B2000000, 17.43559:00000000B0030000000000000100000000000000, 20.52176:140F138B1000101053000000, 20.50032:140F138B801700000F240000, 0.35180:58000000, 255.23226:4800D13D, 255.27962:0A000000, 255.27962:32000000, 255.17082:DC040000, 0.27745:19240000, 4.21921:DC040000, 255.27962:FA000000, 255.1494:4A240000, 0.38698:00000000, 0.37692:01000000, 0.44092:20000100, 0.41232:20000100, 0.60208:20000100, 0.37136:20000100, 0.34608:20000100, 0.55056:20000100, 0.42768:20000100, 0.56112:20000100, 0.52807:20000100, 7.36354:010000000000010920000100, 4.33016:DC040000, 7.40748:010000000000010B20000100, 7.57132:0000000000000000FE40ED2E, 1.63016:32000000, 4.39640:DC040000, 8.45434:41D11875E850074B83D94AA22CD7E47131363A53, 5.10786:0000000031352E32302E323833352E3031363A535932505230314D42323432373A66613865326262372D653363632D343763352D383762642D32323464346333333261643500001000000000, 7.51330:B09BC293A7CBD70802000000, 0.39570:00000000, 1.55954:0A000000, 0.48754:82000000, 0.40818:00000000, 0.56946:9C000000, 1.33010:0A000000, 2.54258:00000000, 0.40002:00000000, 1.56562:00000000, 1.64146:32000000, 1.33010:32000000, 2.54258:DC040000, 255.1750:52260000, 255.31418:BE000000, 0.22753:0A006136, 255.21817:DC040000, 0.64418:C3000000, 4.39842:DC040000, 0.41586:081B0000, 4.60547:DC040000, 0.21966:03000336, 4.30158:DC040000 [Hostname=SY2PR01MB2427.ausprd01.prod.outlook.com]’)

This may help with clues email - SMTP error 554 "Message does not conform to standards" - Stack Overflow

Welcome to the ERPNext community!

Office 365 doesn’t provide to send using different from address other than your username to log in with.

You need both email address same.