List of usage examples for org.springframework.mail MailParseException MailParseException
public MailParseException(String msg, Throwable cause)
From source file:org.grouter.common.mail.MailHandler.java
public void sendEmail(MailDto mailDto) { Properties props = new Properties(); Session session = Session.getDefaultInstance(props, null); MimeMessage mimeMessageContent = new MimeMessage(session); try {// w w w . ja v a2 s . c o m // createHeader(mimeMessageContent, mailDto.getTo(), mailDto.getSubject(), // mailDto.getFrom(), mailDto.getSenderNote()); createHtmlAndPlainTextBody(mimeMessageContent, mailDto); } catch (Exception e) { logger.error(e, e); throw new MailParseException("Failed to create message", e); } // send }
From source file:org.springframework.mail.javamail.JavaMailSenderImpl.java
public MimeMessage createMimeMessage(InputStream contentStream) throws MailException { try {/*from w w w . j ava2 s . com*/ return new MimeMessage(getSession(), contentStream); } catch (MessagingException ex) { throw new MailParseException("Could not parse raw MIME content", ex); } }