> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mailofly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Python

# Python Quickstart

Send your first email with the Mailofly Python SDK.

**Requires:** Python 3.9+ · [API key](api-keys.md) · [Account key](sending-accounts.md)

***

## 1. Install

```bash theme={null}
pip install mailofly
```

***

## 2. Send an email

```python theme={null}
import os
from mailofly import Mailofly

client = Mailofly(os.environ["MAILOFLY_API_KEY"])

result = client.emails.send({
    "from": "Acme <onboarding@example.com>",
    "to": ["you@example.com"],
    "subject": "Hello from Mailofly",
    "html": "<p>It works!</p>",
})

print(result["id"])
```

***

## 3. Check mail logs

```python theme={null}
client.mail_logs.list(page=1, page_size=10)
```

Or open **[Emails](https://www.mailofly.com/user/emails)** in the app.

***

## Next

* [Python SDK](../sdks/python.md) — full reference
* [Sending examples](sending-examples.md)
* [API: Emails](https://docs.mailofly.com/api/emails)


## Related topics

- [Introduction](/api/index.md)
- [Http](/getting-started/http.md)
- [SDKs](/sdks/index.md)
- [Manage Emails](/sending/manage-emails.md)
