Skip to content

SMTP

The SMTP action sends a mail directly through a mail server. It needs no mail program and is therefore suited to PCs that run unattended. With SaveInSent RUNOS also stores a copy in the Sent folder via IMAP.

  • The mail is sent as HTML. If the text already contains HTML tags, it is used unchanged; plain text keeps its line breaks.
  • If Body or Signatur holds the path of a .txt or .html file, RUNOS uses its content, with placeholders replaced.
  • Invalid entries in To, Cc and Bcc are skipped. Attachments that don’t exist are left out silently; if a missing attachment should be an error, use MAPI with MissingAttachments: Error.

In the workflow editor you put the action together in a form and try it with Test step.

{
"Type": "SMTP",
"Name": "SendInvoice",
"Parameters": {
"SmtpServer": "smtp.example.com",
"SmtpPort": 587,
"UseSsl": true,
"SmtpUser": "{{connector.Mailserver.Username}}",
"SmtpPassword": "{{connector.Mailserver.Password}}",
"From": "invoice@example.com",
"FromName": "Accounting Muster GmbH",
"To": "{{InitialData.Recipient}}",
"Subject": "Invoice {{InitialData.Invoice.BT1}}",
"Body": "Hello,\n\nplease find your invoice attached.",
"Attachments": "{{FilePath}}"
}
}
Parameter Default Meaning
SmtpServer – Address of the mail server
SmtpPort 587 Port, usually 587 (STARTTLS) or 465 (SSL)
UseSsl true Use encryption (STARTTLS or SSL, depending on the server)
SmtpUser, SmtpPassword – Sign-in to the server. Without a user, mail is sent without signing in.
From, FromName – Sender address and display name
To, Cc, Bcc – Recipients separated by ; or ,, or the path of a text file with addresses
Subject – Subject. Line breaks become spaces.
Body, Signatur – Text or path of a text or HTML file. The signature goes below the text.
Attachments – File paths separated by ; or ,
SaveInSent false true: after sending, store a copy in the Sent folder via IMAP, see Copy in the Sent folder
ImapServer, ImapPort port 993 IMAP server for SaveInSent, e.g. imap.strato.de
ImapUser, ImapPassword SmtpUser, SmtpPassword Sign-in to the IMAP server. Empty = the same credentials as for SMTP.
SentFolder – Name or path of the Sent folder, e.g. Gesendet. Empty = detect it.
Timeout 60 Time limit in seconds
"Response": {
"Results": [
{
"Recipients": "customer@example.com",
"Subject": "Invoice INV-2026-0001",
"Attachments": [ "C:\\…\\INV-2026-0001.pdf" ],
"Status": "OK",
"Message": "Email sent successfully",
"SaveInSent": {
"Status": "Saved",
"Folder": "Sent",
"Message": "Saved in 'Sent'"
}
}
],
"SuccessCount": 1,
"ErrorCount": 0
}

If sending fails, the action ends with Failed, and the server’s message is in Message and in the log.

Status and Message describe sending only. Whether the copy is in the Sent folder is reported separately in SaveInSent:

SaveInSent.Status Meaning
Off SaveInSent is off
Saved Copy stored in the folder Folder
AlreadyPresent The mail was already in the folder (some servers store sent mail themselves); no second copy
Failed Copy not stored; the reason is in Message
NotSent The mail was not sent, so it was not stored either

With SaveInSent: true, RUNOS signs in to the mailbox via IMAP after sending and stores the mail in the Sent folder. RUNOS picks the folder like this:

  1. If SentFolder is set, that folder (full path or just the name, case does not matter).
  2. Otherwise the folder the server marks as the Sent folder.
  3. Otherwise the first existing one of these folders: Gesendet, Gesendete Objekte, Gesendete Elemente, Gesendete Nachrichten, Sent, Sent Items, Sent Messages, Sent Mail. At STRATO, the Sent folder is called Sent Items over IMAP; the webmail shows it as “Gesendet”.

The log shows the chosen folder (SentFolderSelected) and then SavedInSent. If RUNOS finds no matching folder, it writes a warning with all folders of the mailbox to the log; put one of them in SentFolder.

If storing the copy fails (wrong IMAP server, sign-in, folder), the mail has still been sent: the action ends with Completed and a warning, not with Failed. That way an error policy with retries does not send the mail a second time. For SMTP, also do not set an OnWarningPolicy with Retry, or a warning sends the mail again.

In the diagram of the workflow editor the action has a form (in the settings panel and in the middle column of the test view):

  • Mail server: Server, Port (default 587), Encrypted connection (SSL/TLS) (on by default), User (empty = no sign-in) and Password (shown as dots).
  • Mail: From, Sender name, To, Cc, Bcc, Subject, Text (text or the path of a file, sent as HTML), Signature and Attachments.
  • More options: Save a copy in the Sent folder with IMAP server (port 993; user and password the same as for SMTP by default; the Sent folder is found automatically) and Time limit (seconds) (default 60).

Every field also takes {{…}} placeholders and values you drag in from the Input column of the test view; lists, switches and number fields become a text field when given a {{…}}. Parameters the form does not know are kept under Other parameters. Test step runs the action once, right away, with the data of the earlier steps, and shows the result with errors and warnings. The test really sends the mail.

Every morning at 6:00, send the day’s export file to accounting, with a copy in the Sent folder and three retries on network problems:

{
"Name": "Export to accounting",
"Autostart": true,
"Trigger": { "Type": "Time", "Name": "Morning", "Parameters": { "CronExpression": "0 0 6 * * ?" } },
"Actions": [
{
"Type": "SMTP",
"Name": "Send",
"OnErrorPolicy": { "Strategy": "RetryThenNotify", "MaxRetries": 3, "InitialDelaySeconds": 5 },
"Parameters": {
"SmtpServer": "smtp.example.com",
"SmtpPort": 587,
"SmtpUser": "{{connector.Mailserver.Username}}",
"SmtpPassword": "{{connector.Mailserver.Password}}",
"From": "runos@example.com",
"FromName": "RUNOS",
"To": "accounting@example.com",
"Subject": "Export from %DATE%",
"Body": "C:\\RUNOS\\Templates\\export.html",
"Attachments": "C:\\Export\\Export_%yyyy%-%MM%-%dd%.csv",
"SaveInSent": true,
"ImapServer": "imap.example.com",
"ImapUser": "{{connector.Mailserver.Username}}",
"ImapPassword": "{{connector.Mailserver.Password}}"
}
}
]
}