Looking to schedule some automated emails via Task Scheduler using Gmail (or Office 365 if needed).
Either my Google-Fu is failing me or its much harder than it seems:
$emailSubject = “xxx – Windows Server Backup on $env:computername Completed Successfully” $emailBody = “xxx – The Windows Server Backup job on $env:computername completed successfully!” $username = “email@example.com“
$pwd = “xxx”
$securepwd = ConvertTo-SecureString $pwd -AsPlainText -Force
$credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username, $securepwd
Error I’m mostly getting while experimenting:
Send-MailMessage : The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required.