# MailTask keeps failing

**URL:** <https://forum.flowable.org/t/mailtask-keeps-failing/3733>\
**Category:** Flowable Engine\
**Created:** [April 12, 2019, 12:24pm UTC](https://forum.flowable.org/t/mailtask-keeps-failing/3733 "2019-04-12T12:24:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TodoMary](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/todomary/32/1173_2.png) [@TodoMary](https://forum.flowable.org/u/TodoMary)\
**Post date:** [April 12, 2019, 12:24pm UTC](https://forum.flowable.org/t/mailtask-keeps-failing/3733/1 "2019-04-12T12:24:29Z")

</div>

I’ve set up the config file this way:

```
<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

  <bean id="processEngineConfiguration" class="org.flowable.engine.impl.cfg.StandaloneProcessEngineConfiguration">

    <property name="jdbcUrl" value="jdbc:h2:mem:flowable;DB_CLOSE_DELAY=1000;MVCC=TRUE" />
    <property name="jdbcDriver" value="org.h2.Driver" />
    <property name="jdbcUsername" value="sa" />
    <property name="jdbcPassword" value="" />

    <!-- Database configurations -->
    <property name="databaseSchemaUpdate" value="drop-create" />

	<!-- Test logger -->
	<!-- <property name="configurators">
		<list>
			<bean class="org.flowable.engine.test.impl.logger.ProcessExecutionLoggerConfigurator" />
		</list>
	</property> -->

    <!-- job executor configurations -->
    <property name="asyncExecutor" ref="asyncExecutor" />
    <property name="asyncExecutorActivate" value="false" />

    <property name="asyncFailedJobWaitTime" value="1" />

    <!-- mail server configurations -->
    <property name="mailServerPort" value="587" />

    <property name="mailServers">
      <map>
        <entry key="myEmailTenant">
          <bean class="org.flowable.engine.cfg.MailServerInfo">
            <property name="mailServerHost" value="smtp.google.com" />
            <property name="mailServerPort" value="587" />
            <property name="mailServerUseSSL" value="false" />
            <property name="mailServerUseTLS" value="false" />     
            <property name="mailServerDefaultFrom" value="mymail@gmail.com" />
            <property name="mailServerUsername" value="mymail@gmail.com"/>
            <property name="mailServerPassword" value="mypassword" />
          </bean>
        </entry>
      </map>
    </property>

    <property name="history" value="full" />
    <property name="asyncHistoryEnabled" value="false" />
    <property name="enableEntityLinks" value="true" />
    <property name="enableProcessDefinitionHistoryLevel" value="true" />
    
    <property name="enableProcessDefinitionInfoCache" value="true" />

    <property name="clock">
        <bean class="org.flowable.common.engine.impl.util.TestClockImpl" />
    </property>

    <property name="enableHistoricTaskLogging" value="true"/>

  </bean>
  
  <bean id="asyncExecutor" class="org.flowable.job.service.impl.asyncexecutor.DefaultAsyncJobExecutor">
    <property name="defaultAsyncJobAcquireWaitTimeInMillis" value="1000" />
    <property name="defaultTimerJobAcquireWaitTimeInMillis" value="1000" />
  </bean>
    
  <bean id="throwCustomExceptionBean" class="org.flowable.engine.test.bpmn.event.error.mapError.ThrowCustomExceptionBean" />
  <bean id="throwCustomExceptionDelegate" class="org.flowable.engine.test.bpmn.event.error.mapError.ThrowCustomExceptionDelegate" />

</beans>

```

but whenever I run my instance, the following exception is thrown:

`EmailException: Sending the email to the following server failed : localhost:1025`

I don’t get why it’s sending the email to localhost, aren’t the settings correct? What am I missing?

---

<div class="post-metadata">

**Author:** ![dbmalkovsky](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/dbmalkovsky/32/31_2.png) [@dbmalkovsky](https://forum.flowable.org/u/dbmalkovsky)\
**Post date:** [April 12, 2019, 1:26pm UTC](https://forum.flowable.org/t/mailtask-keeps-failing/3733/2 "2019-04-12T13:26:43Z")

</div>

Are you using Spring Boot?

Searching the [doc](https://www.flowable.org/docs/userguide/index.html#springBootFlowableProperties) and looking in the [source](https://github.com/flowable/flowable-engine/blob/master/modules/flowable-spring-boot/flowable-spring-boot-starters/flowable-spring-boot-autoconfigure/src/main/java/org/flowable/spring/boot/FlowableMailProperties.java) those values are used as defaults for Spring Boot apps:

| Property name | Default value | Description |
| --- | --- | --- |
| flowable.mail.server.host | localhost | The host of the mail server. |
| flowable.mail.server.password | - | The password for the mail server authentication. |
| flowable.mail.server.port | 1025 | The port of the mail server. |
