SendMail (sending emails)
ts
function SendMail(
from: string, // sender (in RFC-822 format)
to: string, // recipient(s) (in RFC-822 format)
subj: string, // subject
body: string, // body of the email
attach: string // full path to a file to be attached
): boolean;
The SendMail
function sends an email using the SMTP configuration from your Server!'s virtual site global settings, so you don't have to put any sensitive information in plain-text in your scripts. In Syncplify Server! this is the preferred way to send emails from your scripts.
NOTE
The to
parameter may contain multiple recipients, separated by semi-colon ;
as you can see in the example below.
Example
ts
{
SendMail('me@me.me', 'you@you.com;it@they.com',
'NEW BACKUP UPLOADED!', 'A new backup has been uploaded!', '');
}