> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paubox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Receiving client

> Full reference for the Paubox PHP SDK receiving API: managing domains, mailboxes, and retrieving inbound email.

Receiving endpoints are exposed through the `PauboxReceiving` class, which uses the same `Token token=` authentication as `Paubox`.

```php theme={null}
use Paubox\Receiving\PauboxReceiving;

$receiving = new PauboxReceiving('YOUR_API_KEY');
```

## Domains

### List domains

```php theme={null}
$domains = $receiving->listReceivingDomains();
```

### Create a domain

```php theme={null}
$domain = $receiving->createReceivingDomain('support');
echo $domain['data']['domain']; // support.inbound.paubox.email
```

Pass `null` to auto-generate a slug.

### Get a domain

```php theme={null}
$domain = $receiving->getReceivingDomain(1);
```

### Delete a domain

```php theme={null}
$receiving->deleteReceivingDomain(1);
```

## Mailboxes

### List mailboxes

```php theme={null}
$mailboxes = $receiving->listMailboxes($domainId);
```

### Create a mailbox

```php theme={null}
$mailbox = $receiving->createMailbox($domainId, 'intake', 'SecurePass123!');
echo $mailbox['data']['email_address'];
```

Pass a fourth argument for `quotaBytes`.

### Get a mailbox

```php theme={null}
$mailbox = $receiving->getMailbox($domainId, $mailboxId);
```

### Delete a mailbox

```php theme={null}
$receiving->deleteMailbox($domainId, $mailboxId);
```

## Emails

### List received emails

```php theme={null}
$emails = $receiving->listReceivedEmails(['limit' => 10]);
```

`after` and `before` cursors are also accepted for pagination.

### Get a received email

```php theme={null}
$email = $receiving->getReceivedEmail('eaaaaab');
echo $email['data']['body']['text'];
```

### Download an attachment

```php theme={null}
$data = $receiving->downloadAttachment('eaaaaab', 'blob123');
file_put_contents('report.pdf', $data);
```
