Sending an email

if(layout.GetNumSheets())
{
  local file="c:/temp/document.pdf";
  if(layout.SaveAsPDF(file, {dialog=0,protection="RC4_40",
                imgMaxDPI=300,imgQuality=0.85, pswView="",pswEdit="",pswFlags=0}))
  {
      local mail={dialog=1,to="[email protected]",subject="PDF File" };
      //mail.to+=";[email protected]"
      mail.file <- file;
      mail.body <- "Dear Customer\nPlease read attached document\n\nThank you,\npriPrinter Script";
      mail.dialog=0;
      SendMail(mail);
  }
}

All samples