---
updatedAt: 2025-07-15T08:41:50.000Z
agentTools:
  projectIndex: https://docs.appery.io/llms.txt
---

# EMAIL Component

Using the EMAIL component to invoke a REST API.

The **EMAIL** component allows you to send an email via API Express without using 3rd party services.

## SMTP

Simple Mail Transfer Protocol (**SMTP**) is an Internet standard for electronic mail (email) transmission.\
Although electronic mail servers and other mail transfer agents use **SMTP** to send and receive mail messages, user-level client mail applications typically use **SMTP** only for sending messages to a mail server for relaying. For retrieving messages, client applications usually use either **IMAP** or **POP3**.

SMTP connections secured by **TLS**, known as **SMTPS**, can be made using **STARTTLS**.

## Email Properties

In the **EMAIL SERVICE** section, you can set:

* ***Smtp Host***
* ***Port***
* ***Username***
* ***Password***
* ***Recipients***
* ***Subject***
* ***Mime type***
* ***Tls enabled***.

In case of the successful sending of an email, the response of the **EMAIL** component is

```json Successful response
{"status": "success"}
```

In case of failed invoking of an email, the response of the **EMAIL** component is

```json Failed response
{
    "status": "failed",
    "failedDetailsMessage": "535-5.7.8 Username and Password not accepted. Learn more at\n535 5.7.8  https://support.google.com/mail/?p=BadCredentials v2sm6640082wmf.40 - gsmtp\n"
}
```

## Samples

Let's consider one of the most popular email services Gmail for sending email messages.

The properties of the **EMAIL** component for Gmail are:\
***Smtp Host*** - 'smtp.gmail.com'\
***Port*** - '587'\
***Username*** - your Gmail account username (eg. '<test.appery@gmail.com>')\
***Password*** - password of your Gmail account\
***Recipients*** - list of recipients (eg. '<info.appery@gmail.com>')\
***Subject*** - your subject (eg. 'TestMessage')\
***Mime type*** - 'text/plain'\
***Tls enabled*** - should be enabled\
***REQUEST BODY*** - the value of the **requestBody** variable of JavaScript expression (in our example the value of **requestBody** will be "Hi, how are you?")

```javascript
requestBody = "Hi, how are you?";
```

<Image align="center" className="border" border={true} src="https://files.readme.io/4e5ebca-googleSmtp.png" />

Play a little with the **EMAIL** component and test not only the positive but also the negative case (specify the incorrect password).