# Configure Mail server configuration for Email task programatically

**URL:** <https://forum.flowable.org/t/configure-mail-server-configuration-for-email-task-programatically/9643>\
**Category:** Flowable Engine\
**Created:** [August 16, 2022, 9:13am UTC](https://forum.flowable.org/t/configure-mail-server-configuration-for-email-task-programatically/9643 "2022-08-16T09:13:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![flowableUser42](https://avatars.discourse-cdn.com/v4/letter/f/7bcc69/32.png) [@flowableUser42](https://forum.flowable.org/u/flowableUser42)\
**Post date:** [August 16, 2022, 9:13am UTC](https://forum.flowable.org/t/configure-mail-server-configuration-for-email-task-programatically/9643/1 "2022-08-16T09:13:41Z")

</div>

Hi,

I am new to flowable and I want to configure the SMTP server to the flowable engine so that I can send emails using “Mail task” in a flowable process. I want to load the mail properties programmatically from the database instead of passing them through the project’s application properties. How can I achieve this?.

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [August 17, 2022, 12:24pm UTC](https://forum.flowable.org/t/configure-mail-server-configuration-for-email-task-programatically/9643/2 "2022-08-17T12:24:38Z")

</div>

Hey @flowableUser42,

Currently the Flowable Mail task does not support programatic configuration of the properties that are currently configurable in the application properties.

If you are interested in such a functionality we are open to receiving and reviewing a PR for it.

Cheers,  
Filip

---

<div class="post-metadata">

**Author:** ![gdharley](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/gdharley/32/2695_2.png) [@gdharley](https://forum.flowable.org/u/gdharley)\
**Post date:** [August 17, 2022, 2:44pm UTC](https://forum.flowable.org/t/configure-mail-server-configuration-for-email-task-programatically/9643/3 "2022-08-17T14:44:41Z")

</div>

Hi User42,  
As Filip says, this isn’t currently supported.  
One option you have is to create your own email delegate service task which retrieves the mail server properties from a database.  
You could even use the default MailActivityBehavior class as a model:  
[flowable-engine/MailActivityBehavior.java at main · flowable/flowable-engine · GitHub](https://github.com/flowable/flowable-engine/blob/main/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/MailActivityBehavior.java)
