> For full documentation please see the [receiving email guide](/guides/receiving-emails/).

## Creating email addresses to receive emails

To read emails in code or tests the first step is to create an email address than can receive emails.

- Sign up for [MailSlurp](/api/) using the [dashboard](https://app.mailslurp.com/)
- Save your API Key for the next steps

### Configure an SDK client

Either use the SMTP settings with any SMTP client as shown below:

- [Gain SMTP access to mailbox](/guides/imap-vs-pop3-smtp/)

Or use one of many [developer toolkits](/developers/) including the recommended [NPM client](/docs/js/).

- `npm install --save mailslurp-client`

Import the client:



```typescript
import { MailSlurp } from "mailslurp-client";
```



Then setup the client with an API Key.



```typescript
const mailslurp = new MailSlurp({ apiKey: your_key_here });
```



### Creating an inbox

Create an email address with a randomly assigned address:



```typescript
const MailSlurp = require("mailslurp-client").default;
const mailslurp = new MailSlurp({
  apiKey: process.env.API_KEY ?? "your-api-key",
});

// create an inbox with options using the inbox controller
const inbox = await mailslurp.inboxController.createInbox({
  // name is used a contact name when sending
  name: "John Doe",
  // use the expanded domain pool so randomly assigned email address is more varied
  useDomainPool: true,
  // permanent by default or supply an expires at time
  expiresAt: undefined,
});
```



## Receive email

Once you have created an inbox send an email to it from your own email client, using the [SDK client](/guides/sending-email/), or using the [MailSlurp dashboard](https://app.mailslurp.com/).
