Java Mail Properties – esmtp authentication error
06.05.2010
Michael Herbold
Last week, we had a problem with sending emails from our application. Currently we use the spring email integration to do this.
An esmtp server runs at customers side, which does not accept the default mail settings we made for our local test environment:
<bean> <property name="host" value="${mail.host}"/> <property name="port" value="${mail.port}" /> <property name="username" value="${mail.user}" /> <property name="password" value="${mail.password}" /> </bean>
Following property fixed the problem (after a long time of experimenting with different mail.smtp.* properties!):
<property name="javaMailProperties"> <props> <prop key="mail.smtp.localhost">mylocalhost</prop> <prop key="mail.smtp.ehlo">false</prop> </props> </property>
With these two settings you create at least the following command that is required to send the mails : helo mylocalhost