Replace app-password SMTP scripts in Microsoft 365

Published · Updated

Save

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.

References

Microsoft OAuth for SMTP AUTH

Microsoft Graph sendMail

Exchange Online Basic authentication status

Discuss this answer