Skip to content

mailkite/ploi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MailKite

MailKite for Ploi

Email for every product you ship — send over a verified domain, receive email as a webhook, give an AI agent its own inbox.
A one-command recipe that wires MailKite into a Ploi-managed Laravel site: set the mail env, optionally create an inbound route, done.

Docs · Library guide · mailkite.dev · AI agents

npm

Read-only mirror. This repo is a generated, release-time mirror of the MailKite monorepo (the private source of truth) — development doesn't happen here. Install from npm and open issues against the MailKite docs.

What it does

Ploi is where a lot of Laravel/PHP devs provision and manage their own VPS sites — a clean, affordable alternative to Forge. Ploi has no built-in email story, but it does expose a site's whole .env over its API. This CLI uses that to add MailKite in one command: it reads the site's .env, splices in the mail configuration, and writes it back. No dashboard clicking, no copy-paste.

Two paths, smtp is the default:

  • --mode smtp (default) — universal SMTP relay, zero code change. Points Laravel's mailer at smtp.mailkite.dev.
  • --mode api — the native mailkite/laravel mailer (MAIL_MAILER=mailkite).

Add --inbound <url> to also create a MailKite inbound webhook route and set MAILKITE_WEBHOOK_SECRET.

Use it

npx mailkite-ploi \
  --token <ploi-api-token> \
  --server <serverId> --site <siteId> \
  --mailkite-key mk_live_... \
  --from you@yourdomain.com \
  [--mode smtp|api] \
  [--inbound https://yoursite.com/api/inbound] \
  [--dry-run]
  • --token — a Ploi API token from ploi.io/profile/api-keys (or set PLOI_API_TOKEN).
  • --mailkite-key — a MailKite API key mk_live_… from the dashboard (or set MAILKITE_API_KEY).
  • --dry-run — print the .env diff (and the route that would be created) without writing anything.

Start with --dry-run to preview the change. The --from domain must be verified on your MailKite account (outbound = SPF + DKIM; inbound routing = MX) — this recipe configures the app; the DNS is set on MailKite.

--mode smtp (default)

Upserts, into the site .env:

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailkite.dev
MAIL_PORT=587
MAIL_USERNAME=apikey
MAIL_PASSWORD=mk_live_…
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=you@yourdomain.com
MAIL_FROM_NAME=${APP_NAME}

Every existing Mail::send() now delivers through MailKite — no code change, no package to install.

--mode api

Upserts MAIL_MAILER=mailkite, MAILKITE_API_KEY, and MAIL_FROM_*, then triggers a Ploi deploy. The native mailer needs the Laravel package installed — add this line to the site's Deploy Script (Manage Site → Deploy Script) so it runs on every deploy:

composer require mailkite/laravel

(Ploi's deploy-script content isn't editable over the API, so this one step is manual; the CLI triggers the deploy for you once the line is in place.)

Receive inbound email

With --inbound https://yoursite.com/api/inbound, the CLI creates a MailKite route (*@yourdomain.com → webhook) and writes MAILKITE_WEBHOOK_SECRET into the .env. Verify the signature in your app with the mailkite/laravel package (verifyWebhook). Full inbound guide: https://mailkite.dev/docs.

All MailKite libraries

Same contract, every language (full list: https://mailkite.dev/docs/libraries):

Library Repo Distribution
MailKite for Ploi (this repo) ploi npm
MailKite for Laravel laravel Packagist
MailKite for PHP mailkite-php Packagist
MailKite for Node.js mailkite-node npm
MailKite for Python mailkite-python PyPI
MailKite for Ruby mailkite-ruby RubyGems
MailKite for Java mailkite-java Maven Central
MailKite for Go mailkite-go Go modules
@mailkite/cli mailkite-cli npm

Docs & links

MIT licensed. © MailKite.

About

MailKite for Ploi — one-command CLI to wire MailKite email into a Ploi-managed Laravel site.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors