For Exchange Online automation, choose an OAuth-capable sending method. An app password still relies on a password-based protocol and does not migrate the script to OAuth.
Choose a supported sending route
Microsoft documents OAuth for SMTP AUTH and the Microsoft Graph sendMail endpoint. Start from the account and workload type, then have the tenant administrator review permissions and any mailbox restrictions. Check Microsoft’s current deprecation schedule if you are maintaining a legacy sender.
Check the script before migrating
Locate the transport and credential source, then update them together in an approved test environment. Use a designated test mailbox and validate the returned response and actual receipt. Keep secrets out of scripts, command history and diagnostic output.
