Quick start
Install PostHog in up to three places:
- Your server: the SDK sends email.
- Your app: PostHog captures the events and people that broadcasts and automations use. If you already use PostHog for Product Analytics, this is done.
- Your coding agent: the MCP builds your emails and reports how they did.
Send email from your server
Get an agent to do it
Run the wizard from your server project. It creates a project secret API key, installs the SDK, and adds the first send to your code.
Send your first email
npx @posthog/wizard emailDo it yourself
Send yourself an email in about a minute. You don't need to set up your domain first. Until you do, PostHog sends from the test sender, which only emails people in your PostHog organization.
- Go to Project secret API keys and click Create project secret API key. Set Transactional email to Write, and copy the key. It starts with
phs_. - Run this, with your key and the email address of your PostHog account. On EU Cloud, use
https://eu.posthog.com.
- Check your inbox. To see the send in PostHog, open the Log tab.
Install an SDK
Or install the SDK yourself:
| SDK | Send | sensitive and tracking | cc, bcc, and attachments |
|---|---|---|---|
| Node.js | 5.62.0 | 5.71.0 | 5.72.0 |
| Python | 7.84.0 | 7.89.0 | 7.91.0 |
| Go | Any v2, or 1.40.0 on v1 | Any v2, or 1.43.0 | Any v2, or 1.44.0 |
| .NET | 2.20.0 | 2.24.0 | 2.25.0 |
| Rust | Any posthog, or posthog-rs 0.31.0 | Any posthog, or 0.32.0 | Any posthog, or 0.33.0 |
| Ruby | 3.30.0 | 3.33.0 | 3.34.0 |
| Elixir | 2.20.0 | 2.21.0 | 2.22.0 |
| PHP | 4.22.0 | 4.24.0 | 4.25.0 |
For another language, use the API. A send needs your secret API key, so send only from your server. The browser and mobile SDKs can't send email.
Capture events from your app
Install PostHog in your app or site. Its events can start an automation, such as a welcome email on signed_up. Its person properties choose who gets a broadcast. Identify each user and set their email person property, so PostHog knows where to send.
Platforms
Frameworks
Connect your agent
The PostHog MCP lets Claude Code, Cursor, Codex, and other agents write emails, build broadcasts and automations, move you off another provider, and report how each email did. Your agent saves its changes as drafts, and you publish them.





