List of utility methods to do Email Send
void | sendMessage(Message msg, Transport transport) Send the message if (msg.getAllRecipients() != null) { transport.sendMessage(msg, msg.getAllRecipients()); } else { throw new AddressException("Mail adress is null"); |
void | sendMimeMessage(MimeMessage mimeMessage) Send the message using the JavaMail session defined in the message try { Transport.send(mimeMessage); } catch (MessagingException e) { throw new RuntimeException(e); |
void | sendResetPasswordMail(String to, String message) send Reset Password Mail sendMail("correo.cipf.es", to, "babelomics@cipf.es", "Genomic cloud storage analysis password reset", message.toString()); |
void | sendResetPasswordMail(String to, String newPassword, final String mailUser, final String mailPassword, String mailHost, String mailPort) send Reset Password Mail Properties props = new Properties(); props.put("mail.smtp.auth", "true"); props.put("mail.smtp.starttls.enable", "true"); props.put("mail.smtp.host", mailHost); props.put("mail.smtp.port", mailPort); Session session = Session.getInstance(props, new javax.mail.Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(mailUser, mailPassword); ... |