> For the complete documentation index, see [llms.txt](https://jasp402.gitbook.io/easy-yopmail-v4/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jasp402.gitbook.io/easy-yopmail-v4/deleteinbox.md).

# deleteInbox()

This feature allows you to empty your inbox by removing all messages.

## **Description:**

The `deleteInbox()` function of Easy-YOPMail v4 enables developers to delete all emails from a specific YOPmail email address. This feature is essential when you need to clear an inbox after conducting tests or when you want to ensure no trace of sensitive emails remains.

## **Practical Use:**

Deleting all emails from an inbox is useful in situations such as:

**Software Testing**: After conducting automated tests that generate multiple emails, you can use `deleteInbox()` to clear the inbox and prepare it for the next set of tests.

**Privacy**: If you've used a temporary email address to receive sensitive or confidential emails, you can use this function to ensure those emails are permanently deleted.

## **Example Code:**

```javascript
const easyYOPmail = require('easy-yopmail');

let email = 'sample_email_address';

easyYOPmail.deleteInbox(email).then(response => {
    console.log(response); // Sample output: true
});
```

## **Parameters:**

The `deleteInbox()` function requires one parameter:

* <mark style="color:red;">`email`</mark>: The email address from which you want to delete all emails.

## **Error Handling:**

If the email address does not exist or there's any other issue while trying to delete the emails, the function will return an error. It's crucial to handle these errors appropriately in your code to prevent execution interruptions.

## **Limitations:**

Once emails are deleted using `deleteInbox()`, they are permanently removed from the YOPmail application and cannot be retrieved.

***

Do you find this format and content suitable for documentation? If there is anything you would like to improve or add, please let me know. <https://github.com/jasp402/Easy-YOPmail/issues/new/choose>
