---
title: t Mail
description: Available triggers
documentId: ipaas-mail-trigger
locale: en-US
---

The Mail component is used to send and receive emails. It is commonly divided into three main protocols:

* IMAP/S for accessing and managing emails on the server.
* POP3/S for downloading emails from the server.
* SMTP/S for sending emails.

## Main fields

*Path parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|----------------|-------------|----------|
| `host` (common) | (required) The email server host name. | — | String |
| `port` (common) | The email server port number. | — | int |

<Callout type="note" title="NOTE">

If the port number is omitted, Camel determines the port number to use based on the protocol.

| Protocol | Default port number |
|----------|--------------------|
| IMAP     | 143                |
| IMAPS    | 993                |
| POP3     | 110                |
| POP3S    | 995                |
</Callout>

*Query parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|----------------|-------------|----------|
| `username` (security) | Username for login. | — | String |
| `password` (security) | Password for login. | — | String |
| `delete` (consumer) | Deletes messages after processing. | false | boolean |
| `unseen` (consumer) | Includes only unread messages. | true | boolean |
| `delay` (scheduler) | Milliseconds before the next poll. | 60000 | long |


## IMAP/IMAPS

The [**IMAP**](https://camel.apache.org/components/4.8.x/mail-component.html) component is a protocol used to receive emails, allowing access to multiple mailbox folders and manipulation of messages directly on the server.

<Callout type="NOTE" title="NOTE">
**IMAPS** is a secure version of IMAP that transmits encrypted data using SSL/TLS.
</Callout>

**URI Syntax**: `imap:host:port` or `imaps:host:port`

### Example

<Steps>
<Step>
The flow uses the secure IMAP protocol (IMAPS) to connect to the Gmail server on port 993, checking the inbox every 60 seconds (`delay=60000`). It fetches only unread emails (`unseen=true`) using the provided credentials (`username` and `password`).
</Step>
<Step>
When it finds new emails, it consumes them and logs the entire content (`showAll=true`), but does not remove them from the server (`delete=false`).
</Step>
</Steps>

```yaml
- from:
  uri:  "imaps:gmail:993"
  parameters:
    username: "yourusername"
    password: "yourpassword"
    delete: false
    unseen: true
    delay: 60000
  steps:
  - to: 
    uri: "log:email"
    parameters:
      showAll: true
```

![](https://creative-ball-51b3fc85c0.media.strapiapp.com/mail_trigger_imaps_421d7150a5.png)

### Result

```
sensedia-integration-camel-poc-9f5f98679-bxrll integration  r18-20020a2e9952000000b002d33999bba9mr921921ljj.21.1710338313808; Wed, 13 Mar
] Right side 2024 at 11:31 AM <camelcomponenttest@gmail.com> wrote::33 -0700 (PDT)]}, BodyType: jakarta.mail.internet.MimeMultipart, Body: Response test using imap
```

## POP3/POP3S

The [**POP3**](https://camel.apache.org/components/4.8.x/mail-component.html) component is used to retrieve emails from POP3 servers, allowing Camel to access the inbox, read messages, and process them automatically in an integration flow.

<Callout type="NOTE" title="NOTE">
**POP3S** is a secure version of POP3 that transmits encrypted data using SSL/TLS.
</Callout>

**Sintaxe da URI**: `pop3:host:port` or `pop3s:host:port`

### Example

<Steps>
<Step>
The flow uses the secure POP3 protocol (POP3S) to check the Gmail inbox every 60 seconds (`delay=60000`), fetching only unread emails (`unseen=true`).
</Step>
<Step>
When it finds new emails, it consumes them and logs the entire content, but does not remove them from the server (`delete=false`).
</Step>
</Steps>

```yaml
- from:
  uri: "pop3s:gmail:995"
  parameters:
    username: "yourusername"
    password: "yourpassword"
    delete: false
    unseen: true
    delay: 60000
  steps:
  - to: 
    uri: "log:email"
    parameters:
      showAll: true
```

![](https://creative-ball-51b3fc85c0.media.strapiapp.com/mail_trigger_pop3s_fe6bbd04b1.png)

#### Result

```
sensedia-integration-camel-poc-7cd5db899f-675pw integration  w6-20020a2e3006000000b002d46f1453d5mr770875ljw.26.1710337734533; Wed, 13 Mar
] Right side 2024 at 11:31 AM <camelcomponenttest@gmail.com> wrote:8:54 -0700 (PDT)]}, BodyType: jakarta.mail.internet.MimeMultipart, Body: Email response test

```
