Send mail via gmail with PowerShell V4
问题 I have been using this PowerShell script to send my an email to me when opened. $EmailFrom = "notifications@somedomain.com" $EmailTo = "anything@gmail.com" $Subject = "sample subject" $Body = "sample body" $SMTPServer = "smtp.gmail.com" $SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587) $SMTPClient.EnableSsl = $true $SMTPClient.Credentials = New-Object System.Net.NetworkCredential("YOURUSERNAME", "YOURPASSWORD"); $SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body) I changed