Skip to content

send-email ​

Sends a file securely to an email address using a download link.

Syntax:

shell
sfiler [options] send-email [Command options] <filename>
Command OptionsRequired/OptionalDescription
-rRequiredComma separated list of email addresses to which the files will be sent.
-stOptionalComma separated list of secret types protecting the files, one per recipient: PASSWORD or NONE. If the option is absent, the NONE type is used for every recipient.
-svOptionalComma separated list of secret values, one per recipient. For PASSWORD, this is the password you must communicate to the recipient. For NONE, the value must be left empty.
-lOptionalComma separated list of languages in which the email must be sent, one per recipient. If the option is absent, the email is sent in English to every recipient.
-tcOptionalTime to live count. Set to determine how many times the file can be download. Default: 0
-tdOptionalSet an absolute expiration date. After this date, the file cannot be downloaded, it will be deleted. (ex: 2011-12-31)
-thOptionalSet a relative expiration date. The file will expire in X hours from now. (ex: 2)
-xOptionalMessage to be appended to the email notice.
-tOptionalSpecify a theme to override the default notification theme.
-gOptionalUpload the file on behalf of a group.

Warning

If path not included in filename, Current path will be assumed.

Warning

The send-email command always uses the download link mode (DOWNLOAD_LINK). The command line does not offer the direct access mode (DIRECT_ACCESS_TOKEN).

Important

The lists supplied to the -r, -st, -sv and -l options must contain the same number of elements, since each position corresponds to one recipient:

  • If the number of -st or -sv values does not match the number of recipients, the command stops with an error message before sending anything.
  • If the number of -l values does not match, the command displays the message "The number of languages (…) must correspond to the number of recipients (…). Transfer canceled." but, despite this message, continues; the server then rejects the transfer with error 5018 (Invalid input field value).

The values of these lists are separated by commas, and the spaces around each value are removed. A value can therefore never contain a comma: a password such as ab,cd is split into two values.

Warning

The -wp option, which existed in versions prior to 4.21.0, has been removed. It is replaced by the combination of the -st and -sv options. See Upgrading to 4.21.0 for the procedure to migrate your scripts.

Warning

Constraints on secret types:

  • NONE is only accepted if your instance security policy allows sends without a secret. The corresponding secret value must be left empty.
  • PASSWORD requires a secret value that complies with the Recipient Password Policy that applies to you.
  • The SMS_OTP and EMAIL_OTP types are rejected by send-email, because these one-time codes require the DIRECT_ACCESS_TOKEN transfer mode, which the command line does not offer.

Examples:

Warning

On Linux, enclose the secret values in single quotes ('...'): within double quotes, the shell interprets characters such as $ and ! before the command receives them.

Sending to a single recipient, protected by a password:

shell
./sfiler.sh -l "my-user" -p "my-password" -s https://www.example.com/sfiler/server/ send-email -r "msmith@mycompany.com" -st PASSWORD -sv 'd7*$hp#1' -x "the file you have requested, I will tell you the password by phone" "my-file.txt"
shell
sfiler.exe -l "my-user" -p "my-password" -s https://www.example.com/sfiler/server/ send-email -r "msmith@mycompany.com" -st PASSWORD -sv "d7*$hp#1" -x "the file you have requested, I will tell you the password by phone" "my-file.txt"

Sending to two recipients with distinct passwords and languages:

shell
./sfiler.sh -l "my-user" -p "my-password" -s https://www.example.com/sfiler/server/ send-email -r "msmith@mycompany.com,jjohnson@thatbusiness.com" -st PASSWORD,PASSWORD -sv 'd7*$hp#1,9k@wQ#4z' -l en,fr "my-file.txt"
shell
sfiler.exe -l "my-user" -p "my-password" -s https://www.example.com/sfiler/server/ send-email -r "msmith@mycompany.com,jjohnson@thatbusiness.com" -st PASSWORD,PASSWORD -sv "d7*$hp#1,9k@wQ#4z" -l en,fr "my-file.txt"