#bonita2021.2

How to attach file in disk to an email dynamically?

We tried to attach file by running a script as follows. But, it didn't attach file to the email. Let me know if there are any other ways of doing this or mistakes in this attempt.

import java.io.File;
import java.util.logging.Logger;

File readFile() {
Logger logger = Logger.getLogger("org.bonitasoft");
File file = new File("C:\\Users\\sachinm\\Downloads\\testDoc.txt")
logger.info("File read");
return file;
}

readFile();

Notifications