剛做完一個電影網站
聲明代碼裡有些內容並非是我一個人完成的
首先在applicationContext
Java代碼
<bean id=
<property name=
</property>
<property name=
<props>
<prop key=
<prop key=
</props>
</property>
<property name=
<property name=
</bean>
實現發送郵件java類代碼
Java代碼
private Configuration cfg = new Configuration();
public static void main(String[] args) throws Exception {
ApplicationContext ctx = new FileSystemXmlApplicationContext(
JavaMailSender sender = (JavaMailSender) ctx
SpringMail springMail = new SpringMail();
springMail
}
private void sendMail(JavaMailSender sender) throws Exception {
SimpleMailMessage mail = new SimpleMailMessage();
mail
mail
mail
//嵌入ftl模版
cfg
Map root = new HashMap();
root
Template t = cfg
StringWriter writer = new StringWriter();
t
//把模版內容寫入郵件中
mail
sender
System
}
這樣還不夠
Java代碼
目錄結構
ok
文章很簡短
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28305.html