# cURL

## Overview

Mailtrap can be integrated with cURL for email sending via SMTP or email API.

Before we start, you'll need to:

* [Verify your sending domain](/email-api-smtp/setup/sending-domain.md)
* [Create and save an API key](/email-api-smtp/setup/api-tokens.md)

### Send emails using cURL and Mailtrap

#### SMTP integration

To integrate Mailtrap via SMTP, go to the **Integration** tab and copy/paste either the credentials or the pre-made code snippets into your configuration.

<div align="left" data-with-frame="true"><img src="/files/TG59Mq2vRMD3e58OfKPd" alt="" width="563"></div>

You can get more information on SMTP integration [here](/email-api-smtp/setup/smtp-integration.md).

#### API integration

To integrate Mailtrap and send emails via cURL, use the configuration available among **Code samples** under the API section.

<div align="left" data-with-frame="true"><img src="/files/9a7RVR0D3DR7SV2XHyXv" alt="" width="563"></div>

Once you copy the script, make sure to insert your Mailtrap API token in the `Authorization` field as `Bearer` and enter your and your recipient's emails in the `--mail-from` and `--mail-rcpt` fields.

**Note**: To learn more about API integration, [click here](/email-api-smtp/setup/api-integration.md).

## Next steps

After setting up cURL integration, you can send test emails and monitor delivery through your Mailtrap dashboard to ensure proper configuration.


---

# 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://docs.mailtrap.io/guides/integrations/curl.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.
