peter
1
Hi ! How do I pass Login credentials into the script? The script is as below.
Please advise.
Thank you
Send-MailMessage -To “peter@123.com” -From “peter@123.com” -Subject “Report $CurrentTime” -Attachments $ListOfAttachments -BodyAsHTML -body $HTMLmessage -priority Normal -Credential $mycreds -SmtpServer “10.66.10.25” -Port 25
Olaf
2
Peter,
Welcome to the forum. 
In the simplest case you store it in the variable $mycreds wtih the cmdlet
If you want to do it properly and secure you may use the new SecretManagement module from MSFT
peter
3
Hi ! Olaf,
Thank you.
Do you have an example for Send-MailMessage using SecretManagement?