Bootstrap

java发送邮件包含js_java中如何实现邮件的发送包括网页文件的发送

package com.company.simplemail;

import java.util.List;

import java.util.Properties;

import javax.mail.MessagingException;

import javax.mail.Multipart;

import javax.mail.Session;

import javax.mail.Transport;

import javax.mail.internet.AddressException;

import javax.mail.internet.InternetAddress;

import javax.mail.internet.MimeBodyPart;

import javax.mail.internet.MimeMessage;

import javax.mail.internet.MimeMessage.RecipientType;

import javax.mail.internet.MimeMultipart;

/**

* 简单邮件发送器,可单发,群发。

*/

public class SimpleMailSender {

//  发送邮件的props文件

private final transient Properties props = System.getProperties();

//    邮件服务器登录验证

private transient MailAuthenticator authenticator;

//    邮箱session

private transient Session session;

;