Skip to content
ErawanACADEMYไทย

Make it real

Sending email from your app — without owning a mail provider

A confirmation, a receipt, a password reset. Sending mail properly usually means an account somewhere, a domain to verify and a key to keep safe. Here it is one command and a POST.

Rather not set it up yourself? Erawan does it for free on Hobby and above.

1. Add email to your app

Have this app send an order confirmation email, using Erawan's email add-on.

From a terminal, run this.

erawan addon add my-app email

The app restarts with EMAIL_API_URL and EMAIL_API_KEY in its environment. The key is issued for this app alone. There is no mail provider to sign up for and no domain to verify. Email comes with the Hobby plan and above.

2. Send one

Have your app send a POST to EMAIL_API_URL with Authorization: Bearer and the key in the header, and a JSON body with to, subject, and html or text. You can add cc, bcc or attachments too. Any language and any HTTP client will do, with nothing to install.

Mail always goes out from no-reply@erawan.app. The sender name people see is your app's name, and from_name changes it. If you want customers to be able to reply to you, put your address in reply_to, or their replies land at no-reply and nobody reads them.

The mail provider's own key never sits in your app. If the key in your app leaks, whoever has it can send only within your account's allowance, and you get a new key by removing the add-on and adding it again.

3. How much you can send

Hobby sends 500 messages in 30 days, Pro 2,000 and Max 5,000, counted across every app in the account. Each recipient counts as one message, so an email to three people counts as three.

Over the allowance, the send is refused with a 429 rather than silently dropped, so your app should catch that error and tell the user, or a customer sits waiting for an email that is never coming.

One message can have at most 50 recipients, counting to, cc and bcc together, and at most 10 attachments with a combined real size of 7 MB.

Not for newsletters

This is for mail caused by something a user did, such as signing up, placing an order or asking for a password reset: one action, one message. Sending a newsletter to many people needs list management, an unsubscribe link and a sending domain of your own, none of which is here. A newsletter service is the better fit.

All Erawan Cloud lessons

Send email from your app — Erawan