sending email from the command line


Recommended Posts

Is there an 'unraid way' to send emails from the terminal? I have a script I wrote that backs up my data to a cloud provider using rclone. The script emails me an HTML table with the status: what was backed up, deleted, etc...

 

The mail command isn't found so before I install it I wanted to see if there is a proper way to do this?

Link to comment
root@unRaidA:/tmp/GitHub/SourceCode/AppFeed# /usr/local/emhttp/plugins/dynamix/scripts/notify
notify [-e "event"] [-s "subject"] [-d "description"] [-i "normal|warning|alert"] [-m "message"] [-x] [-t] [-b] [add]
  create a notification
  use -e to specify the event
  use -s to specify a subject
  use -d to specify a short description
  use -i to specify the severity
  use -m to specify a message (long description)
  use -l to specify a link (clicking the notification will take you to that location)
  use -x to create a single notification ticket
  use -r to specify recipients and not use default
  use -t to force send email only (for testing)
  use -b to NOT send a browser notification
  all options are optional

notify init
  Initialize the notification subsystem.

notify smtp-init
  Initialize sendmail configuration (ssmtp in our case).

notify get
  Output a json-encoded list of all the unread notifications.

notify archive file
  Move file from 'unread' state to 'archive' state.

 

or alternatively the sendmail command

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.