#邮件发送的相关配置 email.host = smtp.163.com email.port = xxx email.username = xxx email.password = xxx email.sendFrom = xxx@163.com
<!-- spring的属性加载器,加载properties文件中的属性 --> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location"> <value>/WEB-INF/configInfo.properties</value> </property> <property name="fileEncoding" value="utf-8" /> </bean>
<!-- 邮件发送 -->
<bean id="mailSender"
class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host">
<value>${email.host}</value>
</property>
<property name="port">
<value>${email.port}</value>
</property>
<property name="username">
<value>${email.username}</value>
</property>
<property name="password">
<value>${email.password}</value>
</property>
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.auth">true</prop>
<prop key="sendFrom">${email.sendFrom}</prop>
</props>
</property>
</bean>
#生成文件的保存路径 file.savePath = D:/test/ #生成文件的备份路径,使用后将对应文件移到该目录 file.backupPath = D:/test bak/
@Component("configInfo")
public class ConfigInfo {
@Value("${file.savePath}")
private String fileSavePath;
@Value("${file.backupPath}")
private String fileBakPath;
public String getFileSavePath() {
return fileSavePath;
}
public String getFileBakPath() {
return fileBakPath;
}
}
@Autowired private ConfigInfo configInfo;
<context:component-scan base-package="com.my.model" />
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有