> For the complete documentation index, see [llms.txt](https://docs.emobiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/app/sendmail.md).

# sendMail

## Description

Sends an email through the app.

## Input / Parameter

| Name       | Description                                | Input Type | Default | Options | Required |
| ---------- | ------------------------------------------ | ---------- | ------- | ------- | -------- |
| config     | The configuration of the email to be sent. | Object     | -       | -       | Yes      |
| from       | The name of the sender.                    | Object     | -       | -       | Yes      |
| to         | The name of the recipient.                 | Array/List | -       | -       | Yes      |
| cc         | The carbon copy.                           | Array/List | -       | -       | No       |
| bcc        | The blind carbon copy.                     | Array/List | -       | -       | No       |
| data       | The contents of the email.                 | Object     | -       | -       | Yes      |
| attachment | The file(s) to be attached.                | Array/List | -       | -       | No       |

## Output

N/A

## Callback?

### callback

The function to be executed when the email is sent successfully.

### errCallback

The function to be executed when the email is not sent successfully.

## Video

Coming Soon.

## Example

The user want to send an email via the app.

### Step

1. Call the sendMail function, add toObject function in "config" parameter as below:

   ![](/files/Yumov5Lk4XtGJX7iIehR)
2. For "from" paremeter, add toObject with "email" & "name".

   ![](/files/RtDOs11zwYsC7GzS6cfB)
3. For "to" paremeter, add toArray function then toObject funtion.

   ![](/files/OPMFjU1bjeiYCdoBgB4z)

   Add fields "email" & "name".

   ![](/files/RDZq2qOvUdJG8wqXGEWD)
4. For "cc" paremeter, add toArray function then toObject funtion.

   ![](/files/h0CPPxJtYkyf4taFMGDP)

   Add fields "email" & "name".

   ![](/files/p87Tc0Ldsi2o2nF88p34)
5. For "data" paremeter, add toObject function then add fields "subject" "body".

   ![](/files/diftfCTrFaxTn808qzOD)

### Result

Email Received: ![](/files/S7ttbgsytOsmwINFvSeN)

## Links
