# Send Email

The SendEmail function is used to send emails to an SMTP server for distribution to recipients.

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, as does this Linx function.

***

### Properties <a href="#properties" id="properties"></a>

#### Content <a href="#content" id="content"></a>

**Subject**

The subject line of the email. This has to be a string that may not exceed 78 characters.

**Body**

The body of the email to be sent.

**Attachments**

Any attachments that need to be sent out with the email. This needs to point to files.

#### Credentials <a href="#credentials" id="credentials"></a>

**Username**

The username to log into the Inbox. This is commonly the email address.

**Authentication**

Authentication type to use when connecting to the email server.

Available options:

* **AuthLogin** - Specifies that the mail server uses plain text authentication. Requires a Password.
* **AuthXOAUTH2** - Specifies that the SMTP server uses the OAUTH mechanism for GMAIL [learn more](https://www.emailarchitect.net/eagetmail/sdk/html/object_oauth.htm) or Office365 [learn more](https://linx.software/blog/using-oauth2-to-access-emails/). Requires a Token.

#### Options <a href="#options" id="options"></a>

**Body format**

The options are *Text* or *HTML*.

**Enable SSL**

SSL is required by some mail servers, including Gmail.

**Port**

The default port is 25, when SSL is enabled it is 587.

**Priority**

Not every email system supports message priority. Clients that do support it, commonly add an exclamation mark to that email or give the email otherwise a higher visibility in the Inbox.

**Timeout**

Send timeout in seconds.

#### Receivers <a href="#receivers" id="receivers"></a>

**To**

The main recipient.

**CC**

Carbon copied recipients. CC recipients are visible to other recipients of an email.

**BCC**

Blind carbon copied recipients. BCC recipients are not be visible to other recipients.

#### Sender <a href="#sender" id="sender"></a>

**From**

The *From* address.

#### Server <a href="#server" id="server"></a>

**Smtp Server**

The server IP address, network name or URL.

***

### Sending Email with Gmail <a href="#sending-email-with-gmail" id="sending-email-with-gmail"></a>

Gmail only uses OAuth2.0 to read and send emails. For more information using the OAUTH mechanism for GMAIL [learn more](https://www.emailarchitect.net/eagetmail/sdk/html/object_oauth.htm) or Office365 [learn more](https://linx.software/blog/using-oauth2-to-access-emails/)

**In Linx Designer**

Set the following properties:

* SMTP Server Address: smtp.gmail.com.
* Authentication: XOAUTH2
* Secure Connection: TLS/SSL based on your mail client/website SMTP plugin.
* SMTP Username: your Gmail account (<xxxx@gmail.com>)
* Token: your Gmail token.
* Gmail SMTP port: 587 (SSL) or 465 (TLS)

***

### Links <a href="#links" id="links"></a>

[Linx Community: Email plugin configuration](https://community.linx.software/t/email-plugin-configuration/406)

[Linx Community: Email filtering](https://community.linx.software/t/email-filtering/407)

[Wikipedia: Simple Mail Transfer Protocol](http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol)

[The Mailman Inside Our Computers. Or: What Is Simple Mail Transfer Protocol?](http://whatismyipaddress.com/smtp)
