# SMTP

> Send email through any mail server.

Built-in step · 1 step. Web page: https://docs.lodol.com/docs/integrations/built-in/smtp

## Steps

### Send an email

Send an email through any mail server, using the SMTP details your provider gives you. Set the server, the sign-in, who it is from and to, and the message, with files from earlier steps attached. Store the password as a workspace secret and reference it so it is never stored in the workflow. For a mailbox Lodol already connects to, such as Gmail or Outlook, use that app's own send action instead.

**Inputs**

- Mail server (`host`, text, required): The SMTP server to send through, such as smtp.example.com. Your email provider lists it under its SMTP or outgoing mail settings.
- Port (`port`, number): The port the server listens on. Leave it empty for the usual one: 587 for STARTTLS, 465 for SSL/TLS, 25 for none.
- Connection security (`security`, text): How the connection is secured. STARTTLS suits port 587 and most providers; SSL/TLS suits port 465. None sends in the clear, for a server on your own network only: it won't sign in to a server on the internet. One of: `starttls`, `ssl` (SSL/TLS), `none`. Default: `starttls`.
- Username (`username`, text): The account to sign in with, usually the full email address. Leave it empty for a server that needs no sign-in.
- Password (`password`, text): The account's password or app password. Store it as a workspace secret and reference it here, for example @secrets.SMTP_PASSWORD, so it is never stored in the workflow.
- From (`sender`, text, required): Who the email is from. A name is allowed, as in Jane Doe <jane@example.com>. Most servers only send from the address signed in with.
- To (`to`, text, required): Who to send to. Separate several addresses with commas, or reference a list from an earlier step; a name is allowed, as in Jane Doe <jane@example.com>.
- Cc (`cc`, text): Who else to send to, visibly. Separate several addresses with commas.
- Bcc (`bcc`, text): Who else to send to, without the other recipients seeing. Separate several addresses with commas.
- Reply-to (`reply_to`, text): Where replies should go, if not to the sender. Separate several addresses with commas.
- Subject (`subject`, text, required): The subject line.
- Body (`body`, text): The message as plain text. Fill in this, the HTML body, or both.
- HTML body (`html_body`, text): A formatted version of the message, as HTML. Mail apps that can show it do; the plain text body is kept for the rest.
- Attachments (`attachments`, list): Files to attach, such as a PDF an earlier step made or downloaded. Upload one, or use a file from an earlier step. Up to 20 files.

**Outputs**

- `from` (text)
- `message_id` (text)
- `recipients` (list)
- `refused_recipients` (list)
- `sent` (true/false)
- `subject` (text)

**Example output**

```json
{
  "from": "example_value",
  "message_id": "example_value",
  "recipients": [],
  "refused_recipients": [],
  "sent": true,
  "subject": "example_value"
}
```
