Package org.exoplatform.services.mail

Examples of org.exoplatform.services.mail.Attachment


    * We check if we can get real cause of exception, if that occurs during
    * message sending process.
    */
   public void testSendMessageAsynchExceptionCause() throws Exception
   {
      Attachment attachment = new Attachment();
      attachment.setInputStream(new ByteArrayInputStream(ATTACHMENT.getBytes()));
      attachment.setMimeType(TEXT_PLAIN);

      Message message = new Message();
      message.setFrom("!@#$%^&*()");
      message.setTo(generateRandomEmailRecipient());
      message.setCC(generateRandomEmailRecipient() + "," + generateRandomEmailRecipient());
View Full Code Here


    */
   public void testSendMessageInFuture() throws Exception
   {
      Message message;

      Attachment attachment = new Attachment();
      attachment.setInputStream(new ByteArrayInputStream(ATTACHMENT.getBytes()));
      attachment.setMimeType(TEXT_PLAIN);

      @SuppressWarnings("unchecked")
      Future<Boolean>[] futures = new Future[THREAD_NUMBER];

      assertEquals("SMTP server should be now empty", 0, mailServer.getMessages().size());
View Full Code Here

      message.setCC(generateRandomEmailRecipient() + "," + generateRandomEmailRecipient());
      message.setBCC(generateRandomEmailRecipient() + "," + generateRandomEmailRecipient());
      message.setSubject(MAIL_SUBJECT);
      message.setBody(MAIL_CONTENTS);
      message.setMimeType(TEXT_HTML);
      Attachment attachment = new Attachment();
      attachment.setInputStream(new ByteArrayInputStream(ATTACHMENT.getBytes()));
      attachment.setMimeType(TEXT_PLAIN);
      message.addAttachment(attachment);

      assertEquals("SMTP server should be now empty", 0, mailServer.getMessages().size());
      assertFalse(isEmailMessageSent(MAIL_SUBJECT));
      service.sendMessage(message);
View Full Code Here

TOP

Related Classes of org.exoplatform.services.mail.Attachment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.