Tutorial: send and receive emails over an API with Smapiz
Updated on
Smapiz plugs into an existing mailbox (SMTP to send, IMAP to receive). Your application sends emails with an HTTP call and receives each new email as a JSON webhook.
1. Create an account
Sign up on the sign-up page and confirm your email address. The free plan includes 1 mailbox and 500 emails per month, no credit card required.
2. Connect a mailbox
In Mailboxes, click Connect mailbox, pick your provider, enter the address and password, then Test connection. Details in Connect a mailbox.
Note the mailbox ID (mbx_…): you pass it in every send call.
3. Create an API key
In API keys, click Create key. The key (smz_live_…) is shown only once: copy it into your server’s environment variables.
4. Send an email
curl https://smapiz.com/v1/messages \
-H "Authorization: Bearer smz_live_..." \
-H "Content-Type: application/json" \
-d '{
"mailbox_id": "mbx_...",
"to": "[email protected]",
"subject": "Hello",
"text": "First email sent with Smapiz."
}'The email shows up in Messages with its status. More options in Send an email with the API.
5. Receive inbound emails
In Webhooks, add your application’s URL and tick message.received. Every email arriving in the mailbox is POSTed to you. See Receive emails as webhooks.
The full API reference is at /docs.