Created
December 2, 2015 20:30
-
-
Save pkskelly/0b16f9892234e88c50c3 to your computer and use it in GitHub Desktop.
Sending Email from PowerShell using SendGrid (in Azure)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Username ="azure_*********@azure.com" | |
$Password = ConvertTo-SecureString "********" -AsPlainText -Force | |
$credential = New-Object System.Management.Automation.PSCredential $Username, $Password | |
$SMTPServer = "smtp.sendgrid.net" | |
$EmailFrom = "admin@acme.com" | |
$EmailTo = "user@acme.com" | |
$Subject = "SendGrid test" | |
$Body = "SendGrid testing successful" | |
Send-MailMessage -smtpServer $SMTPServer -Credential $credential -Usessl -Port 587 -from $EmailFrom -to $EmailTo -subject $Subject -Body $Body |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The operation has timed out.