-
-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#841: improvements to User.send_mail method
- Loading branch information
Showing
8 changed files
with
271 additions
and
26 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,24 @@ | ||
""" | ||
Send the message specified in the request body using either JSON or MIME format. | ||
The example is adapted from https://docs.microsoft.com/en-us/graph/api/user-sendmail?view=graph-rest-1.0 | ||
""" | ||
|
||
from office365.graph_client import GraphClient | ||
from office365.outlook.mail.item_body import ItemBody | ||
from tests import ( | ||
test_client_id, | ||
test_password, | ||
test_tenant, | ||
test_user_principal_name_alt, | ||
test_username, | ||
) | ||
|
||
client = GraphClient.with_username_and_password( | ||
test_tenant, test_client_id, test_username, test_password | ||
) | ||
client.me.send_mail( | ||
subject="Meet for lunch?", | ||
body=ItemBody.create_html("<h1>The new cafeteria is open.</h1>"), | ||
to_recipients=["[email protected]", test_user_principal_name_alt], | ||
).execute_query() |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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