Read mail and codes from your app
Create a private link for a mailbox once, then read its messages, verification codes and full email HTML as JSON. Reading a link needs no sign-in.
Quick start: private mail API (72-hour or 8-day links)
- 1Create a link with
POST /?action=createCodeLink, your existing app credential and the email you want. - 2Read it with
GET /getcode/PRIVATE_LINK_TOKEN: no header required. - 3Poll the same URL every 15 seconds or more until a
codearrives.
The link URL works like a password: anyone who has it can read that mailbox. Links expire 72 hours after creation, or 8 days when created with lifetime=8d. You can also paste a link into the web viewer.
POST /?action=createCodeLink
Send a full email on an enabled domain. Requires an existing application credential in X-Api-Key or Authorization. Anonymous requests and browser cookies are rejected. Creating a link sends no email.
| Field | Meaning |
|---|---|
email | Required. The full address to read. |
lifetime | Optional. 72h (default when left out) or 8d for an 8-day link. Any other value is rejected with 400. |
curl -X POST 'https://email.yamin.bd/?action=createCodeLink' \ -H 'X-Api-Key: YOUR_EXISTING_APP_CREDENTIAL' \ --data-urlencode 'email=chosen@SERVICE_DOMAIN'
8-day link
curl -X POST 'https://email.yamin.bd/?action=createCodeLink' \ -H 'X-Api-Key: YOUR_EXISTING_APP_CREDENTIAL' \ --data-urlencode 'email=chosen@SERVICE_DOMAIN' \ --data-urlencode 'lifetime=8d'
Response
{
"status": "success",
"email": "chosen@SERVICE_DOMAIN",
"url": "https://email.yamin.bd/getcode/PRIVATE_LINK_TOKEN",
"expires": 1800259200,
"expires_at": 1800259200
}expires and expires_at are Unix seconds. Reading a link never extends it; the lifetime is fixed when the link is created.
GET /getcode/PRIVATE_LINK_TOKEN
The URL is the credential, so no header is needed. GET returns JSON; HEAD only checks that the link works.
curl 'https://email.yamin.bd/getcode/PRIVATE_LINK_TOKEN?page=0'
Response (shortened example)
{
"status": "success",
"email": "chosen@SERVICE_DOMAIN",
"code": "482913",
"message_id": "EXAMPLE_MESSAGE_ID",
"received_at": "2026-11-07T09:00:00Z",
"messages": [
{
"id": "EXAMPLE_MESSAGE_ID",
"code": "482913",
"subject": "Your verification code",
"from": "Example <no-reply@example.com>",
"text": "Your code is 482913",
"html": "<!DOCTYPE html><html><head><style>…</style></head>…",
"html_safe": "<p>Your code is 482913</p>",
"html_raw": "<!DOCTYPE html>…",
"text_raw": "Your code is 482913",
"truncated": false
}
],
"total": 1,
"page": 0,
"page_size": 10,
"has_more": false,
"next_page": null,
"expires_at": 1800259200
}Paging
messages are newest first, 10 per page, and page starts at 0. Keep requesting next_page until has_more is false. The first page may not be the whole mailbox.
Response fields
| Field | Meaning |
|---|---|
status | success when the newest email has a code. waiting means it has none yet; the inbox may still have mail. |
code, message, message_id, received_at | The newest email in the whole mailbox and its code, on every page. code is null if none was detected. |
messages | This page of emails, newest first. |
total | Number of emails, or null if unknown. |
page, page_size, has_more, next_page | Paging. next_page is null on the last page. |
expires_at | When the link stops working (Unix seconds). |
Each item in messages
| Field | Meaning |
|---|---|
id | Message id. |
code | Code found in this email only, or null. Emails without a code are still listed. |
subject | Subject line. |
from, from_name, from_address | Sender. from is Name <address>. |
date, received_at | The email's own Date header, and when the server received it. |
html | The email's HTML exactly as received, the same as Mailpit shows it. Render it in a sandboxed iframe. |
html_raw | Same as html, kept for older clients. |
html_safe | A sanitized copy with no styles, images, links, scripts or forms. Only for inserting directly into your own page; it won't look like the original. |
text | The plain-text part, or readable text taken from the HTML. |
text_raw | The original plain-text part, or empty. |
truncated | true if a body was over 200,000 characters and was cut. Then use html_safe. |
Missing parts are empty strings. Bodies are decoded parts only, not raw MIME or attachments.
Render emails exactly as received
html is the email as it was sent, so rendering it looks the same as Mailpit. Email HTML comes from strangers, so always load it in a sandboxed iframe, never directly into your page:
const frame = document.createElement('iframe');
// No allow-scripts and no allow-same-origin: the email can't run code or read your page.
frame.setAttribute('sandbox', 'allow-popups allow-popups-to-escape-sandbox');
frame.referrerPolicy = 'no-referrer';
frame.style.cssText = 'width:100%;height:80vh;border:0;background:#fff';
frame.srcdoc = msg.truncated ? msg.html_safe : msg.html;
document.querySelector('#mail').appendChild(frame);- Never assign
htmltoinnerHTML. In a mobile app, use a WebView with JavaScript turned off. - Keep the background white. Emails are designed for white, even in dark mode.
- Remote images can act as read receipts. To block them, add
<meta http-equiv="Content-Security-Policy" content="img-src data:">to the email's<head>. - Images attached inside the email (
cid:) are not included.
Errors and refresh
| HTTP | When |
|---|---|
| 400 | Create: invalid or unavailable address. Read: invalid page. |
| 401 | Create: missing or invalid app credential. |
| 404 | Read: link invalid, expired or revoked. |
| 429 | Too many requests. Wait and retry. |
| 502 | Mail server unavailable. Retry with backoff. |
Reuse the same link and refresh no faster than every 15 seconds. Results are cached for 15 seconds, and expiry is checked on every read.
Action API
These endpoints read a mailbox directly by its address. Call them from your own server only. Every query uses the ?action=NAME format.
Authentication
Send an existing application credential in the Authorization header (X-Api-Key also works). Requests without it return Unauthorized. Replace YOUR_TOKEN below with your credential.
curl -H "Authorization: YOUR_TOKEN" "https://email.yamin.bd/?action=getMessages&user=alex&domain=acetaiaterrenere.com"
Domains
Supported: @2ndgmail.com, @acetaiaterrenere.com, @acisdigital.com, @ahccentralcoast.com, @ahradigital.com, @aislingmedical.net, @aleyacomercial.com, @americanfundingllc.com, @andreasfunkl.com, @annmareeblack.com, @antoniojlg.com, @aqhtraining.uk, @aradmins.com, @aramaicestates.com, @asabross.com, @aselsun.com, @atlantictradecommerce.com, @automotovate.com, @av-technology.com, @avignonconsulting.com, @beileinfant.com, @belloservice.com, @blancaguillot.com, @blrecruitingsolutions.com, @bluenotesolution.com, @caedzgroup.com, @cakesonwheels.net, @careeradvisorsrecruiting.com, @cerezomontilla.com, @ceydaorganizasyon.com, @cnptlcable.com, @coachfinderuae.com, @codexiurisabogados.com, @comprodel.com, @conexioncallcenter.com, @continentaltransportationservices.com, @cpdpartners.uk, @cpwhiteproperties.com, @cubiertasymontajesmadrid.com, @dc-executives.com, @dfycatalog.com, @digitalmandala.uk, @doobydash.com, @eaclglobal.com, @eastlaketile.com, @ecopavi.com, @editingforesl.com, @elysiumcf.com, @embroidme-stamford.com, @enkiedificacion.com, @enlifeint.com, @envinaria.com, @ermaconstrucciones.com, @fatmartian.com, @fernandeztorrens.com, @fhweb.net, @firstfixcontractors.com, @flippingdepot.com, @freedomfundinggrp.com, @freshaccounting.net, @galacticmarketingllc.com, @georgehotelhenfield.com, @globaltraineracademy.com, @glovetrainer.com, @gshopt.com, @hamllc.net, @hertimetocode.com, @higher-lending.com, @hostalrestaurantemoyano.com, @hr-email.com, @huricana.com, @ibiella.com, @idealvehiclesolutions.com, @ims123.net, @irismediainc.com, @jamesdhaga.com, @janus27.com, @jerseyrealestateco.com, @jmvirtualassistant.uk, @jromanfotografia.com, @laviled.com, @leadsomatic.net, @libo-conveyor.com, @liseller.net, @llsz.xyz, @loffco.com, @lomatelier.com, @lovelocol.com, @maclanejr.com, @magroupllc.com, @marketingninjas.uk, @mayersalestraining.com, @medicaljobmarketplace.com, @mehmetservetconstruction.com, @mgcantabria.com, @mialanedesign.com, @miracle-trims.com, @ml-agency.net, @modernworldsolutions.com, @momentumadinc.com, @nitcy.site, @tplink.info, @yamin.bd, @zteck.net. Choose the inbox with user=name@acetaiaterrenere.com or user=name&domain=acetaiaterrenere.com. Without a domain, @2ndgmail.com is used. Disabled domains are not listed and are rejected.
Endpoints
?action=statusCheck that the service is online.?action=getDomainsList the supported domains.?action=genRandomGenerate a random username.?action=getMessages&user=USERNAME&domain=DOMAINFetch the latest 50 messages for that address.?action=readMessage&user=USERNAME&domain=DOMAIN&id=MESSAGE_IDRead one message's HTML body and extracted codes.?action=deleteSingleMessage&user=USERNAME&domain=DOMAIN&id=MESSAGE_IDDelete one message.?action=deleteInbox&user=USERNAME&domain=DOMAINPermanently clear the inbox for that address.