List of usage examples for javax.mail MessagingException MessagingException
public MessagingException(String s, Exception e)
From source file:org.xwiki.mail.internal.DefaultMailSender.java
@Override public void send(MimeMessage message, Session session) throws MessagingException { DefaultMailResultListener listener = new DefaultMailResultListener(); sendAsynchronously(message, session, listener); waitTillSent(Long.MAX_VALUE); BlockingQueue<Exception> errorQueue = listener.getExceptionQueue(); if (!errorQueue.isEmpty()) { throw new MessagingException(String.format("Failed to send mail message [%s]", message), errorQueue.peek());/*from w w w .ja v a 2s . co m*/ } }