Skip to main content

Groovy Script

Explanation

This script performs the following operations:
  1. JSON Parse: JSON message coming from request body is parsed
  2. Sender Validation: Sender information is checked and converted to email address
  3. Recipient Check: At least one recipient (TO, CC or BCC) must exist
  4. Email Sending: Email is sent via SMTP
  5. Response Creation: Operation result is returned as response in JSON format

Sample Request

Sample Response

This script should be run on the request line (Request Policy) because it uses the requestBodyTextFromClient and requestErrorMessageFromClient variables.