Skip to content

Instantly share code, notes, and snippets.

@darrelmiller
Created January 13, 2021 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darrelmiller/abe10957af1da43a0cc1a34f1b20071f to your computer and use it in GitHub Desktop.
Save darrelmiller/abe10957af1da43a0cc1a34f1b20071f to your computer and use it in GitHub Desktop.
Send an Email using Microsoft Graph PowerShell
Install-Module Microsoft.Graph
Connect-MgGraph
$Message = @{
"subject" = "Yo"
"body" = @{
"content" = "Here is my message"
}
"toRecipients" = @(
@{
"emailAddress" = @{
"address" = "user@example.com"
}
}
)
}
Send-MgUserMail -userId sender@domain.org -Message $Message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment