Drive email entirely from Ruby: send with one call, receive every inbound message as parsed JSON on a webhook, and give any app or AI agent its own inbox on a domain you control — with no mail server to run.
Add the Ruby library:
gem install mailkite One endpoint, one API key — over your own authenticated domain. Send API reference →
require "mailkite"
mk = Mailkite::Client.new(ENV["MAILKITE_API_KEY"])
res = mk.send(
"from" => "hello@myapp.ai",
"to" => "ada@example.com",
"subject" => "Your invoice #1042",
"html" => "<p>Thanks! Receipt attached.</p>"
) Point your domain's MX at MailKite and every message arrives as parsed JSON — verify the signature, then handle it. No IMAP, no mail server.
require "sinatra"
require "json"
require "mailkite"
post "/hooks/mailkite" do
raw_body = request.body.read
sig = request.env["HTTP_X_MAILKITE_SIGNATURE"]
halt 401 unless Mailkite.verify_webhook(sig, raw_body, ENV["MAILKITE_WEBHOOK_SECRET"])
event = JSON.parse(raw_body)
# ...handle event["type"] == "email.received"
content_type :json
Mailkite.reply_ok # {"status":"ok"}
end Go deeper: Email to webhook: the complete guide, or give an AI agent its own inbox.
Send, receive, and agent inboxes — the same shape in every language. See the full picture →
Unlimited domains ·Unlimited mailboxes ·3,000 emails/mo — 100 emails/day. Pricing →