Quickstart
The Free plan sends from a sandbox address Duta gives you, to up to three people who agreed to receive your test mail. It needs no domain and no card.
-
Create an account. Sign in with GitHub at app.duta.indra.sh.
-
Choose your sandbox address. In the dashboard, pick the name for your address. Mail will come from
<name>@sandbox.duta.indra.sh. -
Add a recipient. Add your own email address as a sandbox recipient. Duta emails it a confirmation link. Open it and confirm. A sandbox send only reaches an address that confirmed.
-
Create an API key. Under API keys, create one. It is shown once, so copy it now. Keep it in an environment variable, never in your code.
Terminal window export DUTA_API_KEY=duta_xxxxxxxxxxxxxxxx -
Send.
Terminal window curl https://api.duta.indra.sh/v1/emails \-H "Authorization: Bearer $DUTA_API_KEY" \-H "Content-Type: application/json" \-d '{"from": "Kedai <yourname@sandbox.duta.indra.sh>","to": "you@example.com","subject": "Hello from Duta","html": "<p>It works.</p>"}'Terminal window npm install @duta/sdkimport { Duta } from '@duta/sdk';const duta = new Duta(process.env.DUTA_API_KEY);const { data, error } = await duta.emails.send({from: 'Kedai <yourname@sandbox.duta.indra.sh>',to: 'you@example.com',subject: 'Hello from Duta',html: '<p>It works.</p>',});Terminal window composer require duta/duta-php$duta = new Duta\Duta(getenv('DUTA_API_KEY'));$sent = $duta->emails->send(['from' => 'Kedai <yourname@sandbox.duta.indra.sh>','to' => 'you@example.com','subject' => 'Hello from Duta','html' => '<p>It works.</p>',]);On Laravel, set
MAIL_MAILER=dutainstead. See Laravel.Terminal window pip install duta-sdkfrom duta import Dutaduta = Duta() # reads DUTA_API_KEYsent = duta.emails.send({"from": "Kedai <yourname@sandbox.duta.indra.sh>","to": "you@example.com","subject": "Hello from Duta","html": "<p>It works.</p>",})Terminal window go get github.com/indra-sh/duta-goclient := duta.NewClient(os.Getenv("DUTA_API_KEY"))sent, err := client.Emails.Send(ctx, &duta.SendEmailRequest{From: "Kedai <yourname@sandbox.duta.indra.sh>",To: []string{"you@example.com"},Subject: "Hello from Duta",HTML: "<p>It works.</p>",})Terminal window dotnet add package Duta.Netvar duta = new DutaClient(Environment.GetEnvironmentVariable("DUTA_API_KEY"));var sent = await duta.Emails.SendAsync(new SendEmailRequest{From = "Kedai <yourname@sandbox.duta.indra.sh>",To = ["you@example.com"],Subject = "Hello from Duta",Html = "<p>It works.</p>",});Duta answers
202with the message id:{ "id": "msg_...", "status": "sent" } -
Check it. The email arrives with a short footer saying it came from a sandbox. In the dashboard, Emails shows the message and Logs shows the request.
- Plans and limits for what the sandbox allows and what a paid plan adds.
- Domains to send from your own domain on a paid plan.
- Webhooks to hear about deliveries and bounces.