sendmail

Passes the incoming record as email. The sendmail command loads the input into the mail queue as soon as it comes in and sends the mail asynchronously. Administrative privileges are required to execute this command.

Note
To send email, you need to configure the mail server in the System Settings menu.

Syntax

sendmail [html=BOOL]
Optional Parameter
html=BOOL
Option to regard the message field value received as input as html format and parses the body of the mail (default: f).
  • t: Parses the message field as html.
  • f: Parses the message field as plain text.

Description

The fields as required input are as follow:

to
Email addresses separated by a comma(,).
subject
Email subject.
message
Email body text.

If the input field is missing or the address list is incorrect, the command records an error message in the _sendmail_fail field. However, errors caused by missing SMTP settings are not displayed.

Note
You can use the 'logpresso.mailQueue' command to see a list of outgoing mail currently pending and delete it at once with the logpresso.clearMailQueue command in the logpresso shell.

Usage

Create to, subject, and message fields and pass them to the sendmail command to send an email.

json "{}"
| eval to="example_1@example.com, example_2@example.com",
     subject="Hello World",
     message="<h1>Hello, World</h1>"
| sendmail html=t