# Email Verifier

Check deliverability of an email (valid, accept_all, invalid, unknown, disposable). Clean a list before a campaign: know which addresses are deliverable, risky (accept-all) or invalid.

**Credits:** 1 verification credit (unknown and disposable results are free). Lookups that find nothing cost nothing. See [Pricing and limits](../pricing-and-limits).

## Inputs and options

Input: `email` (Email address)

| Option          | Type    | Default | Description                                              |
| --------------- | ------- | ------- | -------------------------------------------------------- |
| `enrich_mobile` | BOOLEAN | `false` | Also look up mobile phones (+5 credits per phone found). |

## Try one value

```sql
CALL TOMBA.core.email_verifier('jane.doe@acme.com');
```

The call returns the result as a `VARIANT` (example values, shortened):

```json
{
    "status": "found",
    "credits": 1,
    "results": [
        {
            "EMAIL": "jane.doe@acme.com",
            "STATUS": "valid",
            "RESULT": "deliverable",
            "SCORE": 99,
            "ACCEPT_ALL": false
        }
    ]
}
```

`status` is `found`, `not_found`, `invalid` or `error`; `results` holds the output columns and `data` the complete
Tomba record.

## Run it over a table

Create a small table to try it (or use one of yours, after [granting the app access](../installation#3-let-the-app-read-your-tables)):

```sql
CREATE OR REPLACE TABLE my_db.public.contacts (EMAIL STRING);
INSERT INTO my_db.public.contacts VALUES
    ('jane.doe@acme.com'),
    ('info@globex.com');
GRANT SELECT ON TABLE my_db.public.contacts TO APPLICATION TOMBA;
```

Run the tool, then read the results:

```sql
CALL TOMBA.core.verify_emails('MY_DB.PUBLIC.CONTACTS', 'EMAIL', 'CONTACTS_EMAIL_VERIFIER', 100);

SELECT INPUT_EMAIL, STATUS, RESULT, SCORE, ACCEPT_ALL, DISPOSABLE, WEBMAIL
  FROM TOMBA.results.CONTACTS_EMAIL_VERIFIER
 WHERE lookup_status = 'found';
```

Signature: `verify_emails(input_table STRING, email_column STRING, output_table STRING, max_rows INT DEFAULT 100000)`

<Callout type="tip">
    Start with a small `max_rows` (like 100) to check the match rate on your
    data, then run the whole table, in the [background](../background-runs) if
    it is large.
</Callout>

## Output columns

Each row starts with `INPUT_<name>` columns (your values, unchanged) and then has:

`EMAIL`, `STATUS`, `RESULT`, `SCORE`, `ACCEPT_ALL`, `DISPOSABLE`, `WEBMAIL`, `GIBBERISH`, `BLOCK`, `GREYLISTED`, `MX_CHECK`, `SMTP_SERVER`, `SMTP_CHECK`, `SMTP_PROVIDER`, followed by the [common columns](../reference/output-columns)
(`LOOKUP_STATUS`, `CREDITS`, `DATA`, `SOURCE`, …).

## Tips

- `STATUS` is one of `valid`, `accept_all`, `invalid`, `unknown`, `disposable`. Unknown and disposable results are free.
- Send only `valid` addresses, and treat `accept_all` as risky: the server accepts every address, so it can't be confirmed.
- Verifying uses verification credits; they cost the same as search credits.

## Related

- [Email Finder](./email-finder)
- [Email Enrichment](./email-enrichment)
