Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- final String username = "newemail543212345@gmail.com";
- final String password = "741852963qazwsxedc";
- Properties props = new Properties();
- props.put("mail.smtp.auth", "true");
- props.put("mail.smtp.starttls.enable", "true");
- props.put("mail.smtp.host", "smtp.gmail.com");
- props.put("mail.smtp.port", "587");
- Session session = Session.getInstance(props,
- new javax.mail.Authenticator() {
- protected PasswordAuthentication getPasswordAuthentication() {
- return new PasswordAuthentication(username, password);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement