Hi Glenn Maxwell,
Please use the following command:
Send-MailMessage -SmtpServer smtp.office365.com -Credential $credential -From 'svcacct@contoso.com' -To 'user1@contoso.com' -Subject 'Test' -Port 587 -UseSsl
Note: that the -UseTSSL switch should not use any parameters, such as STARTTLS.
In addition, check the following settings for SMTP AUTH:
- Disabling security defaults
- Check if SMTP authentication is enabled for this user
- Exclude the user from a Conditional Access policy that blocks Legacy Authentication
- Disable Multi-Factor Authentication (MFA) on the licensed mailbox that's being used
Please refer to this link for details: Fix issues with printers, scanners, and LOB apps that send email using Microsoft 365 - Exchange | Microsoft Learn
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.