[ Home ] [ Tech Tips ] [ Raspberry Pi ] [ Powershell ] [ Ubuntu ] [ Django ] [ About ]
Powershell using Send-MailMessage to send email

Powershell | using Send-MailMessage to send email 

$UserName = “[email protected] ”
$Password = Get-Content .\SecurePassword.txt | ConvertTo-SecureString
$Credential = New-Object -TypeName System.Management.Automation.PSCredential `
-ArgumentList $UserName, $Password
# Send-MailMessage Email
Send-MailMessage -To [email protected] -From [email protected] -Credential $Credential -SmtpServer test.techgeek.biz -UseSsl -Subject “Backup -Body “Backup script completed”


Luke Keam
Thank you for reading. Any questions, comments or suggestions email me [email protected]
Luke Keam
techgeek.biz

FOLLOW US

Name
Email:

AD