sendMail

void sutil.sendMail ( String subject, String body, String recipients ) (enterprise edition only)
void sutil.sendMail ( String subject, String body, String recipients, String attachments, String headers ) (enterprise edition only)
void sutil.sendMail ( String subject, String body, String recipients, String contentType, String attachments, String headers ) (enterprise edition only)

Description

Send an email using SMTP mail server specified in the settings.

Parameters

  • subject Subject line of the email, as a string.
  • body The content of the email, as a string.
  • recipients Comma-delimited list of email address to which the email will be sent, as a string.
  • contentType The content type as a valid MIME type.
  • attachments Comma-delimited list of local file paths to files that should be attached, as a string.
    If you do not have any attachments the value of null should be used.
  • headers Tab-delimited SMTP headers to be used when sending the email, as a string. If you don't have
    any headers to send use the value null.

Return Values

Returns void. If it runs into any problems while attempting to send the email an error will be thrown.

Change Log

Version Description
6.0.35a Now supports alternate content types.
5.0 Moved from session to sutil.
4.5 Available for enterprise edition.

Examples

Send Email at End of Scrape

 // In script called "After scraping session ends"

 // Sends an email message with the parameters shown.
 String message = "The '" + session.getName() + "' scrape is now finished.";
 sutil.sendMail( "Status Report: Scrape Finished", message, "[email protected]", null, null );