Skip to content

Instantly share code, notes, and snippets.

@gregjhogan
Last active May 31, 2016 17:10
Show Gist options
  • Select an option

  • Save gregjhogan/b57ac31bc7c933d3d2145cf2ae056dc3 to your computer and use it in GitHub Desktop.

Select an option

Save gregjhogan/b57ac31bc7c933d3d2145cf2ae056dc3 to your computer and use it in GitHub Desktop.
Azure Office 365 SMTP send
$Cred = Get-Credential
$From = $Cred.UserName
$To = $Cred.UserName
$Body = "Hello World!"
$Subject = "O356 SMTP Test"
Send-MailMessage -To $To -Subject $Subject -Body $Body -BodyAsHtml -UseSsl -Port 587 -SmtpServer 'smtp.office365.com' -From $From -Credential $Cred
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment