result.setNrErrors( 1 ); } catch ( MessagingException mex ) { logError( "Problem while sending message: " + mex.toString() ); result.setNrErrors( 1 );
@Override public String toString() { return exception.toString(); }
private int reportByEmail(UserFeedback report) { try { sendReportByEmail(report, FEEDBACK_REPORT_EMAIL_SUBJECT); LOGGER.info("Successfully reported by email"); } catch (MessagingException me) { System.out.println("Failed report by email" + me.toString()); return -1; } return 0; }
private static String causeDescription(MessagingException e) { String message = e.getMessage(); return String.format("[%s]%s", e.getClass().getName(), message != null ? message : e.toString() ); } }
public void sendMails() { custList.forEach(customer -> { try { // This should be a bit more flexible :-( Mailer.send("mailhost", customer, "http://www.darwinsys.com/", subject, messageBody); System.out.println(customer + " HANDOFF OK"); } catch (MessagingException e) { System.out.println(customer + " failed: " + e.toString()); } }); } }
/** * Write the object to the output stream, using the specific MIME type. */ public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException { if (obj instanceof MimeMultipart) { try { ((MimeMultipart)obj).writeTo(os); } catch (MessagingException e) { throw new IOException(e.toString()); } } } }
/** * Write the object to the output stream, using the specific MIME type. */ public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException { if (obj instanceof MimeMultipart) { try { ((MimeMultipart)obj).writeTo(os); } catch (MessagingException e) { throw new IOException(e.toString()); } } } }
public CharSequence title() { final String subject; try { subject = message.getSubject(); } catch ( MessagingException e ) { throw new RuntimeException( e.toString() ); } if ( subject == null ) return (CharSequence)factory.resolve( MetadataKeys.TITLE, factory.defaultMetadata ); else return subject; }
public CharSequence title() { final String subject; try { subject = message.getSubject(); } catch ( MessagingException e ) { throw new RuntimeException( e.toString() ); } if ( subject == null ) return (CharSequence)factory.resolve( MetadataKeys.TITLE, factory.defaultMetadata ); else return subject; }
public CharSequence title() { final String subject; try { subject = message.getSubject(); } catch ( MessagingException e ) { throw new RuntimeException( e.toString() ); } if ( subject == null ) return (CharSequence)factory.resolve( MetadataKeys.TITLE, factory.defaultMetadata ); else return subject; }
public CharSequence title() { final String subject; try { subject = message.getSubject(); } catch ( MessagingException e ) { throw new RuntimeException( e.toString() ); } if ( subject == null ) return (CharSequence)factory.resolve( MetadataKeys.TITLE, factory.defaultMetadata ); else return subject; }
public void removeAttachment(String filename) { BodyPart part = new MimeBodyPart(); DataSource src = new FileDataSource(filename); part.setDataHandler(new DataHandler(src)); part.setFileName(filename); try { _multipart.removeBodyPart(part); } catch(MessagingException e) { Log.e(TAG, "Got Exception while removing BodyPart: " + e.toString(), e) } }
public void close() throws IOException { super.close(); try { folder.close( false ); store.close(); } catch( MessagingException e ) { throw new IOException( e.toString() ); } }
public InputStream stream( final int index ) throws IOException { ensureDocumentIndex( index ); try { // Can you believe that? Javamail numbers messages from 1... return folder.getMessage( index + 1 ).getInputStream(); } catch ( MessagingException e ) { throw new IOException( e.toString() ); } }
public InputStream stream( final long index ) throws IOException { ensureDocumentIndex( index ); try { // Can you believe that? Javamail numbers messages from 1... return folder.getMessage( (int)( index + 1 ) ).getInputStream(); } catch ( MessagingException e ) { throw new IOException( e.toString() ); } }
public InputStream stream( final long index ) throws IOException { ensureDocumentIndex( index ); try { // Can you believe that? Javamail numbers messages from 1... return folder.getMessage( (int)( index + 1 ) ).getInputStream(); } catch ( MessagingException e ) { throw new IOException( e.toString() ); } }
public void close() throws IOException { super.close(); try { folder.close( false ); store.close(); } catch( MessagingException e ) { throw new IOException( e.toString() ); } }
public void close() throws IOException { super.close(); try { folder.close( false ); store.close(); } catch( MessagingException e ) { throw new IOException( e.toString() ); } }
public void close() throws IOException { super.close(); try { folder.close( false ); store.close(); } catch( MessagingException e ) { throw new IOException( e.toString() ); } }
public InputStream stream( final int index ) throws IOException { ensureDocumentIndex( index ); try { // Can you believe that? Javamail numbers messages from 1... return folder.getMessage( index + 1 ).getInputStream(); } catch ( MessagingException e ) { throw new IOException( e.toString() ); } }