Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String to = "abc@example.com";
- String user = "sp@example.com";
- String pass = "1234";
- Properties props = new Properties();
- props.put("mail.smtp.host", "smtp.example.com");
- props.put("mail.smtp.port", "587");
- props.put("mail.smtp.auth", "true");
- props.put("mail.smtp.starttls.enable", "true");
- Session session = Session.getInstance(props,new javax.mail.Authenticator()
- {
- protected PasswordAuthentication getPasswordAuthentication()
- {
- return new PasswordAuthentication(user,pass);
- }
- session.setDebug(true);
Add Comment
Please, Sign In to add comment