| | |
| | | */ |
| | | public class EmailUtil { |
| | | |
| | | /* |
| | | * gmail邮箱SSL方式 |
| | | */ |
| | | private static void gmailssl(Properties props) { |
| | | final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory"; |
| | | props.put("mail.debug", "true"); |
| | | props.put("mail.smtp.host", "smtp.gmail.com"); |
| | | props.put("mail.smtp.ssl.enable", "true"); |
| | | props.put("mail.smtp.socketFactory.class", SSL_FACTORY); |
| | | props.put("mail.smtp.port", "465"); |
| | | props.put("mail.smtp.socketFactory.port", "465"); |
| | | props.put("mail.smtp.auth", "true"); |
| | | } |
| | | |
| | | |
| | | //gmail邮箱的TLS方式 |
| | | private static void gmailtls(Properties props) { |
| | | props.put("mail.smtp.auth", "true"); |
| | |
| | | |
| | | final String displayName = "I-GO";//昵称 |
| | | final String username = "i-gotech@i-go.group";// gmail 邮箱 |
| | | final String password = "mbhyptngnvlewdxo";// Google应用专用密码 |
| | | final String password = "wpwfkrlvridoayyh";// Google应用专用密码 |
| | | Session session = Session.getInstance(props, |
| | | new Authenticator() { |
| | | protected PasswordAuthentication getPasswordAuthentication() { |
| | |
| | | return true; |
| | | } |
| | | |
| | | /* |
| | | * gmail邮箱SSL方式 |
| | | */ |
| | | private static void gmailssl(Properties props) { |
| | | final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory"; |
| | | props.put("mail.debug", "true"); |
| | | props.put("mail.smtp.host", "smtp.gmail.com"); |
| | | props.put("mail.smtp.ssl.enable", "true"); |
| | | props.put("mail.smtp.socketFactory.class", SSL_FACTORY); |
| | | props.put("mail.smtp.port", "465"); |
| | | props.put("mail.smtp.socketFactory.port", "465"); |
| | | props.put("mail.smtp.auth", "true"); |
| | | } |
| | | |
| | | public static String getWeek(int language, int i) { |
| | | String week = ""; |