-
-
Notifications
You must be signed in to change notification settings - Fork 372
Expand file tree
/
Copy pathsend.py
More file actions
23 lines (20 loc) · 688 Bytes
/
send.py
File metadata and controls
23 lines (20 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""
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 tests import (
test_client_id,
test_password,
test_tenant,
test_user_principal_name_alt,
test_username,
)
client = GraphClient(tenant=test_tenant).with_username_and_password(
test_client_id, test_username, test_password
)
client.me.send_mail(
subject="Meet for lunch?",
body="The new cafeteria is open.",
to_recipients=["fannyd@contoso.onmicrosoft.com", test_user_principal_name_alt],
).execute_query()