`
dengyin2000
  • 浏览: 1225609 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

Spring mail sender configruation sample

阅读更多
    <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
      <property name="host" value="${mail.host}"/>
         <property name="username" value="${mail.username}"/>
        <property name="password" value="${mail.password}"/>
        <property name="defaultEncoding" value="UTF-8"/>
        <property name="javaMailProperties">
            <props>
                <prop key="mail.smtp.auth">${mail.smtp.auth}</prop>
                <prop key="mail.smtp.timeout">${mail.smtp.timeout}</prop>
            </props>
        </property>
    </bean>

<bean id="templateMessage" class="org.springframework.mail.SimpleMailMessage">
  <property name="from" value="${mail.from}"/>
    <property name="to" value="${mail.to}"/>
  <property name="subject" value="${mail.subject}"/>
</bean>

 

######### Email config #########
mail.from=xx-dev@china.xx.com
mail.host=192.168.1.203
mail.smtp.auth=false
mail.smtp.timeout=25000
mail.username=
mail.password=

reference: http://static.springframework.org/spring/docs/2.5.x/reference/mail.html

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics