Spring javamailSenderImpl bean configuration for Gmail

    <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
	  <property name="defaultEncoding" value="UTF-8"/> 
          <property name="host" value="smtp.gmail.com"/>
          <property name="port" value="465"/> 
          <property name="username" value="..."/> <!-- e.g. username@gmail.com -->
          <property name="password" value="..."/>
          <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>
No comments yet.

Leave a Reply