Add some password validation.

This commit is contained in:
Me Car 2016-01-11 11:15:01 +09:00
parent 8dd1e21dba
commit f99660a451
6 changed files with 50 additions and 19 deletions

View file

@ -63,6 +63,10 @@ public class GmailClient {
}
public static boolean sendMessage(String email, String subject, String text) {
if (email.length() == 0) {
logger.info("Email is not sent because the address is empty");
return false;
}
try {
Gmail gmail = new Builder(httpTransport, JSON_FACTORY, credential).setApplicationName("XMage Server").build();