Groovy Send Mail

mail@pastecode.io avatar
unknown
groovy
3 years ago
441 B
5
Indexable
Never
Map<String,String> emailParams = [:]
emailParams.put("to", "PeterMailaddress1@gmail.com")
emailParams.put("subject", "Sending mail from a business rule using groovy" )
emailParams.put("body", "This is the body of the groovy mail..." )

HttpResponse<String> jsonResponse = operation.application.getConnection("Mail")
.post("/sendmail")
.header("Content-Type","application/x-www-form-urlencoded")
.queryParams(emailParams)
.asString()