我正在使用此代码发送电子邮件
Email email = new SimpleEmail();
email.setHostName("smtp.googlemail.com");
email.setSmtpPort(465);
email.setAuthenticator(new DefaultAuthenticator("username", "password"));
email.setSSLOnConnect(true);
email.setFrom("user@gmail.com");
email.setSubject("TestMail");
email.setMsg("This is a test mail ... :-)");
email.addTo("foo@bar.com");
email.send();
http://commons.apache.org/proper/commons-email/userguide.html
我怎么知道 foo@bar.com 是否是真实的电子邮件并且它接收到消息?
email.addTo("foo@bar.com");