Jodd发送邮件

 

public static void main(String[] args) {
        Email email = Email.create().from("xxx")
                .to("xxx@163.com").subject("test").addText("Hello!");
        SmtpServer smtpServer = SmtpSslServer.create("smtp.qq.com")
                .authenticateWith("xxx@qq.com", "xxx");
        SendMailSession session = smtpServer.createSession();
        session.open();
        session.sendMail(email);
        session.close();
    }

 

posted on 2017-01-10 14:27  Simle  阅读(193)  评论(0编辑  收藏  举报