## MedplumClient.sendEmail() method

Sends an email using the Medplum Email API.

Builds the email using nodemailer MailComposer.

### Examples:

**Signature:**

```typescript
sendEmail(email: MailOptions, options?: MedplumRequestOptions): Promise<OperationOutcome>;
```

### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| email | [MailOptions](/content/docs/sdk/core.mailoptions) | The MailComposer options. |
| options | [MedplumRequestOptions](/content/docs/sdk/core.medplumrequestoptions) | _(Optional)_ Optional fetch options. |

**Returns:**

Promise<OperationOutcome>

Promise to the operation outcome.

### Example 1

Send a simple text email:

```typescript
await medplum.sendEmail({

to: 'alice@example.com',

cc: 'bob@example.com',

subject: 'Hello',

text: 'Hello Alice',

});
```

### Example 2

Send an email with a `Binary` attachment:

```typescript
await medplum.sendEmail({

to: 'alice@example.com',

subject: 'Email with attachment',

text: 'See the attached report',

attachments: [{
    filename: 'report.pdf',
    path: "Binary/" + binary.id
  }]

});
```

See the [nodemailer MailComposer options](https://nodemailer.com/extras/mailcomposer/) for full details.
