Sending an email with attachments

,
ObjectDB obj = getGrant().getTmpObject("myObject");
ObjectField myObjectFile = obj.getField("myObjFile"); // must be of type file

// https://www.simplicite.io/resources/4.0/javadoc/com/simplicite/util/tools/MailTool.html
MailTool mail = new MailTool(getGrant());
mail.addRcpt("contact@null.fr");
mail.setSubject("Test Mail");
mail.addAttach(obj, myObjectFile); 
mail.setBody("<p>Hello</p>");
mail.send();