-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathtest.py
More file actions
26 lines (18 loc) · 732 Bytes
/
test.py
File metadata and controls
26 lines (18 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from dendrite import AsyncDendrite
async def send_email(to, subject, message):
client = AsyncDendrite(auth="outlook.live.com")
# Navigate
await client.goto(
"https://outlook.live.com/mail/0/", expected_page="An email inbox"
)
# Create new email and populate fields
await client.click("The new email button")
await client.fill("The recipient field", to)
await client.press("Enter")
await client.fill("The subject field", subject)
await client.fill("The message field", message)
# Send email
await client.press("Enter", hold_cmd=True)
if __name__ == "__main__":
import asyncio
asyncio.run(send_email("charles@dendrite.systems", "Hello", "This is a test email"))