Skip to content

SendMail (sending emails)

ts
function SendMail(
  from:   string, // sender (RFC-822 format)
  to:     string, // recipient(s) (RFC-822 format, semicolon-separated for multiple)
  subj:   string, // subject
  body:   string, // body of the email
  attach: string  // full path to a file to attach (optional, use '' for none)
): boolean;

Sends an email using the SMTP configuration from your Server!'s virtual site global settings. This avoids exposing sensitive information in your scripts and is the preferred way to send emails from Syncplify Server! scripts.

NOTE

The to parameter can include multiple recipients, separated by a semicolon (;).

Example

ts
SendMail(
  'me@me.me',
  'you@you.com;it@they.com',
  'NEW BACKUP UPLOADED!',
  'A new backup has been uploaded!',
  ''
);