I’m referencing this URL: https://blogs.technet.microsoft.com/ccarroll/2017/11/28/use-powershell-to-send-email-from-o365-account/
to send an automated email. I would like to use a different username and password to connect to the smtp server. I found this URL to encrypt my password. https://support-desktop.sharegate.com/hc/en-us/articles/115000640868-Hide-credentials-in-scripts
1.) How can I incorporate the encrypted password into the Send-MailMessage command?
2.) Is there a better or more secure way of doing this?
thanks in advance!