Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$MyService = @()
$EmailFrom = @()
$Subject = @()
$Body = @()
$computer = @()
$computer = gc env:computername
$SMTPServer = "smtp.sendgrid.net"
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)
$SMTPClient.EnableSsl = $false
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential("<USERNAME>", "<PASSWORD>");
$EmailFrom = "$computer@domain.com.au"
$EmailTo = "someone@domain.com"
$Subject = "Job Name: $JOBNAME, $RESULT, Errors: $ERRORS, Synced: $SYNCOK"
$Body = "$ALLARGS"
$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.