For ease of use, we use commons-email library in the org.activiti.engine.impl.bpmn.behavior.MailActivityBehavior. If you want to use javax.mail or any other framework, you can just implement a custom JavaDelegate and use that in a serviceTask, instead of en email-task and use field-injection (see userguide) to configure the from, to, … fields in the BPMN-file. Inside your JavaDelegate implementation, you can access those fields and populate an email-message and send it.