ezmail.pro

Get emails and OTP codes with one request

Call GET /api/get_mail.php with an inbox address and an API key. You get JSON with the latest emails, and any 5–8 digit code already extracted into the code field.

Shared free API key 0 requests left today
YOUR_API_KEY
Personal API key
Everyone shares the free key, so it can run out of requests. Log in to get a personal key and add more requests.

Try it

Send a real request to the API with the free key and see the JSON it returns. Send an email to this address, then send the request again to see the code.

Get mail for an inbox

Returns up to 10 of the latest emails sent to the address, each with a code extracted from the subject or body.

GET https://ezmail.pro/api/get_mail.php

Parameters

NameDescription
emailrequiredInbox address, for example user@ezmail.pro. If you forward another mailbox (such as Gmail) to an inbox on your own domain, you can also pass that mailbox's address here.
apikeyrequiredThe free key above, or your personal key from Account settings.
houroptionalOnly return emails from the last N hours. hour=1 means the last hour.
dayoptionalOnly return emails from the last N days. Ignored when hour is set.

Response

FieldTypeDescription
statusbooleantrue when there is at least 1 email. false when the inbox is empty or an error occurred.
messagestringDescribes the result, or what went wrong.
data[]arrayEmails, newest first.
data[].codestring5–8 digit code from the subject (checked first) or the body. Empty if none is found.
data[].subjectstringEmail subject.
data[].from_fieldstringSender.
data[].datestringTime received, as YYYY-MM-DD HH:MM:SS (Vietnam time, UTC+7).
data[].html_contentstringFull HTML body of the email.
data[].uidstringUnique email ID.
data[].statusstringunseen or seen.
remaining_requestsnumberRequests left on the key after this one.
Each request that returns emails uses 1 request from the key. Requests that find an empty inbox are free, so you can poll every few seconds while you wait for an email.

Example response

{
  "status": true,
  "message": "Emails loaded",
  "data": [
    {
      "uid": "da1398df-0719-41a9-96db-6e3ca418c0ab",
      "subject": "Your verification code is 359761",
      "from_field": "no-reply@example.com",
      "date": "2026-09-30 17:05:28",
      "html_content": "<!DOCTYPE html>…",
      "status": "unseen",
      "code": "359761"
    }
  ],
  "remaining_requests": 994
}

Get domains

Lists the domains that can receive mail. Pass your API key to include your private domains.

GET https://ezmail.pro/api/get_domains.php

Parameters

NameDescription
apioptionalYour API key. With a key, the list also includes your private domains. Without one, it has only public domains.

Response

FieldTypeDescription
data[].domainstringDomain name, used after the @.
data[].typestringpublic_domain, user_domain (your private domain) or shared_domain (a private domain shared with you).
data[].datestringDate the domain was registered.
data[].expirationstringDate the domain expires.
userstring | nullUsername for the key you passed, or null if you didn't pass one.
The list includes only domains whose MX record points to this server.

Example response

{
  "status": true,
  "message": "Domains loaded",
  "data": [
    {
      "domain": "example.com",
      "date": "2025-04-09",
      "expiration": "2026-09-20",
      "user": null,
      "type": "public_domain"
    }
  ],
  "user": null
}

Common errors

On error, the API returns "status": false and the reason in message.

messageCause and fix
No emails foundThe inbox has no emails yet (within hour/day, if set). This doesn't use a request, so wait a few seconds and call again.
Invalid API key. Check the apikey parameter.The key is wrong or has been changed. Copy your current key from Account settings.
No requests left on this API key. Top up the key or try again tomorrow.The key has used all its requests. The free key refills every day. You can top up a personal key on the Donate page.
You don't have access to this addressThe address is on a private domain you cannot read. Only its owner, accounts it is shared with, and admins can use it. For an outside address (such as Gmail), you need a domain of your own or one shared with you.

Code samples

Wait for an email, then print its code. Replace email with your inbox.