package sentmail; import java.text.SimpleDateFormat; import java.util.Date; public class Test { public static void main(String[] args) { String from = "[email protected]"; //发件人电子邮箱 String pass = "1"; String rcpt = "[email protected]"; //收件人电子邮箱 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(); } }
测试发送邮件3
猜你喜欢
转载自blog.51cto.com/11732619/2677254
今日推荐
周排行