spring发送邮件(通过邮箱激活)
最近做了做了个注册,需要通过邮箱激活才能成为会员的功能;我采用了spring配置的方式实现的:1、首先配置:applicationContext3.xml:<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" " http://www.springframework.org/dtd/spring-beans.dtd "><beans> <bean id="sender" }); SpringMail mail=new SpringMail(); JavaMailSender sender = (JavaMailSender) ctx.getBean("sender"); mail.sendMessage(sender, "****@163.com ", "<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'></head><body>恭喜你,成为本站会员,<a href='http://www.123jihuo.com/first.do?mother=mail&sign=33'>请点击此链接激活您的帐号!" + "</a></body></html>"); }}?