-
-
Save mnjstwins/491ec8ad0145ce38b813700cf4b69998 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 = "[email protected]" | |
$EmailTo = "[email protected]" | |
$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