-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3e99629
commit f0d3173
Showing
2 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Import-Module $PSScriptRoot\..\Mailozaurr.psd1 -Force | ||
|
||
# It seems larger HTML is not supported. Online makes sure it uses less libraries inline | ||
$Body = EmailBody { | ||
EmailText -Text 'This is my text' | ||
EmailTable -DataTable (Get-Process | Select-Object -First 5 -Property Name, Id, PriorityClass, CPU, Product) | ||
} -Online | ||
|
||
# Credentials for Graph | ||
$ClientID = '0fb383f1' | ||
$DirectoryID = 'ceb371f6' | ||
$ClientSecret = 'VKDM_' | ||
|
||
$Credential = ConvertTo-GraphCredential -ClientID $ClientID -ClientSecret $ClientSecret -DirectoryID $DirectoryID | ||
|
||
# Sending email | ||
Send-EmailMessage -From @{ Name = 'Przemysław Kłys'; Email = '[email protected]' } -To '[email protected]' ` | ||
-Credential $Credential -HTML $Body -Subject 'This is another test email 1' -Graph -Verbose -Priority High | ||
|
||
# sending email with From as string (it won't matter for Exchange ) | ||
Send-EmailMessage -From '[email protected]' -To '[email protected]' ` | ||
-Credential $Credential -HTML $Body -Subject 'This is another test email 2' -Graph -Verbose -Priority Low |
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