# initiateEmailVerification()

This function is crucial for sending OTP verification emails, enhancing user security by delivering dynamic and time-sensitive authentication codes. Its versatility extends to diverse applications, ensuring a reliable and secure means of user identity confirmation.

> Here's an example:

```typescript
import { createBackendFunction, utils } from "@magicjs.dev/backend";

export default createBackendFunction(async function () {
    await utils.initiateEmailVerification("user@gmail.com", 1102); // recipient email, OTP
    return "OTP Sent!";
});
```

{% hint style="danger" %}
The proper functioning of `initiateEmailVerification()` necessitates an active subscription with [mern.ai](https://mern.ai/).&#x20;

Without a valid subscription, the functionality may not perform as intended. Ensure that you have the requisite subscription in place to enable seamless email verification initiation.
{% endhint %}

[Click here to refer GitHub.](https://github.com/skyslit/magicjs.dev/blob/main/packages/backend/src/utils.ts#L56)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://skyslit.gitbook.io/magicjs/api-references/backend/utils/initiateemailverification.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
