一:pom配置 jar包
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.5</version>
</dependency>
二:需要发送邮件的端口,服务,邮件及账户和秘密
配置在mail.properties
email.host=mailsss
email.port=25
email.template.path=\\cn\\sss\\ssss\\mail\\temp
email.from=发送的邮件账户
username=名字
password=秘密
三:操作类
public class EmailHelper {
private static final ResourceBundle bundle = ResourceBundle.getBundle("mail");
private static final String sendFrom = bundle.getString("email.from");
private static final String username = bundle.getString("username");
private static final String password = bundle.getString(&#