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.
YOUR_API_KEY
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.
https://ezmail.pro/api/get_mail.php
Parameters
| Name | Description |
|---|---|
emailrequired | Inbox 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. |
apikeyrequired | The free key above, or your personal key from Account settings. |
houroptional | Only return emails from the last N hours. hour=1 means the last hour. |
dayoptional | Only return emails from the last N days. Ignored when hour is set. |
Response
| Field | Type | Description |
|---|---|---|
status | boolean | true when there is at least 1 email. false when the inbox is empty or an error occurred. |
message | string | Describes the result, or what went wrong. |
data[] | array | Emails, newest first. |
data[].code | string | 5–8 digit code from the subject (checked first) or the body. Empty if none is found. |
data[].subject | string | Email subject. |
data[].from_field | string | Sender. |
data[].date | string | Time received, as YYYY-MM-DD HH:MM:SS (Vietnam time, UTC+7). |
data[].html_content | string | Full HTML body of the email. |
data[].uid | string | Unique email ID. |
data[].status | string | unseen or seen. |
remaining_requests | number | Requests left on the key after this one. |
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.
https://ezmail.pro/api/get_domains.php
Parameters
| Name | Description |
|---|---|
apioptional | Your API key. With a key, the list also includes your private domains. Without one, it has only public domains. |
Response
| Field | Type | Description |
|---|---|---|
data[].domain | string | Domain name, used after the @. |
data[].type | string | public_domain, user_domain (your private domain) or shared_domain (a private domain shared with you). |
data[].date | string | Date the domain was registered. |
data[].expiration | string | Date the domain expires. |
user | string | null | Username for the key you passed, or null if you didn't pass one. |
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.
| message | Cause and fix |
|---|---|
No emails found | The 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 address | The 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.
ADS
🚀 Autofb.Pro – Your SMM Panel
Social media services for marketers, businesses & resellers.
👉 Explore now at Autofb.Pro