I used the springmail to send email from my smtp server with the following config:
<bean id="springEmailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="defaultEncoding" value="UTF-8"/>
<property name="host" value="mail.myserver.com"/>
<property name="port" value="25"/>
<property name="username" value="username"/>
<property name="password" value="password"/>
<property name="javaMailProperties">
<value>
mail.debug=true
mail.smtp.auth=true
mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
mail.smtp.socketFactory.fallback=false
</value>
</property></bean>
But it throw "javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?" I've tested this config with gmail on port 465 and it worked.
Please tell me what i've done wrong. Thank you