Sorry if this is in the wrong forum, wasn't sure where to put it.

I'm having problems setting up and using the JavaMailSenderImpl bean/class. Here is my XML config:

<bean id="javaMailSender" class="org.springframework.mail.javamail.JavaMailS enderImpl">

<property name="javaMailProperties">
<props>
<!-- <prop key="mail.smtp.auth">true</prop> -->
<prop key="mail.smpt.auth">false</prop>
<prop key="mail.smtp.starttls.enable">true</prop>
<prop key="mail.smtp.timeout">25000</prop>
</props>
</property>

<property name="host" value="smtp.gmail.com" />
<property name="username" value="user@gmail.com" />
<property name="password" value="pass" />
<property name="port" value="465" />
<property name="protocol" value="smtp" />
</bean>


I usually get a connection has timed out error. I've tried using ports 25, 587 and changing the settings to smtps and setting mail.smpts.auth to true.

What is the proper way to set this up and getting this to work with gmail? I've seen another post on this but it didn't seem to work out for me.