package sentmail;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Test {
public static void main(String[] args) {
String from = "cm5@leejay.com.cn"; //发件人电子邮箱
String pass = "1";
String rcpt = "cm5@leejay.com.cn"; //收件人电子邮箱
String server = "192.168.31.138"; // 服务器
String port = "25";
Date date =new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
StringBuffer subject = new StringBuffer();
subject.append("Java测试邮件 " + sdf.format(date));
Mail sentmail = new SendMail(from, pass, rcpt, server, port, subject.toString()); //向上转型
sentmail.sentmail();
}
}