How to set -password property for Send-MailMessage cmdlet?

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!

 

Install-Module AZSBTools
$Cred = Get-SBCredential -UserName 'my smtp user name'

# to see built-in help
help Get-SBCredential -Show

Works great! Thanks Sam.

BTW - The spelling for the module above should be AZSBTools for anyone else looking to install this module.