Email Task allows us to send an email within a BPMN Process.
Email Task is configured with following properties.
Filed Name | Is mandatory property | Description |
---|---|---|
To | Yes | The recipient of the email. Multiple recipients can be specified as comma separated email addresses |
From | No | The sender email address. If not specified, the default email address specified in the activiti.xml is used |
Subject | No | Subject of the email |
CC | No | The carbon copy receivers of the email. Multiple recipients are separated by commas. |
Bcc | No | The bcc's of the e-mail. Multiple recipients are separated by commas. |
Charset | No | Charset of the email can be changed |
Html | No | The content of email is in html format |
Text | No | Content is in non html format. |
Sample Email Server Configuration
The Activiti engine sends e-mails using an external mail server. Following properties should be set in the activiti.xml configuration file in your server. For example settings , we are using gmail server configuration settings.
<property name="mailServerHost" value="smtp.gmail.com"/>
<property name="mailServerPort" value="587"/>
<property name="mailServerDefaultFrom" value="mailtasktest1@gmail.com"/>
<property name="mailServerUseTLS" value="true"/>
<property name="mailServerUsername" value="mailtasktest1@gmail.com"/>
<property name="mailServerPassword" value="mailtask123"/>
In <property name="mailServerDefaultFrom" value=”email of the sender”> include the default address of the sender in case you don't specify the sender in the mail task properties.
Following two properties specify the username and password of the sender for authentication purposes.
<property name="mailServerUsername" value="mailtasktest1@gmail.com"/>
<property name="mailServerPassword" value="mailtask123"/>
Here you should include the email address and the password you specified in the “from” field of the mail task.