Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.dwerth.sendmail;
- import java.util.Properties;
- import javax.mail.PasswordAuthentication;
- public class SMTPAuthenticator extends javax.mail.Authenticator {
- private Properties props;
- public SMTPAuthenticator(Properties props) {
- this.props = props;
- }
- public PasswordAuthentication getPasswordAuthentication() {
- String username = props.getProperty("mail.smtp.user");
- String password = props.getProperty("mail.smtp.password");
- return new PasswordAuthentication(username, password);
- }
- }
Add Comment
Please, Sign In to add comment