Ejemplo n.º 1
0
 /**
  * 测试下载多封附件.
  *
  * @throws MessagingException
  */
 @Test
 public void testDlAttachments() throws MessagingException {
   PropertiesDeploy propertiesDeploy = new PropertiesDeploy();
   propertiesDeploy.init();
   WebAccount account = new WebAccount();
   setWebAccount(type, account);
   Clickoo_message message = new MessageService().selectMessageById(Long.parseLong(mid));
   new PropertiesDeploy().init();
   EmailCacheObject emailCache = EmailCacheManager.get(mid);
   if (emailCache == null) {
     emailCache = new EmailCacheObject();
   }
   new DLEMailSupport()
       .dlMail(emailCache, Constant.DOWNLOAD_ALL_ATT, message, account, null, "2", mid);
 }
Ejemplo n.º 2
0
  /**
   * 测试下载正文.
   *
   * @throws MessagingException
   */
  @Test
  public void testDlBody() throws MessagingException {
    System.out.println(EmailCacheManager.removeEmail(mid));
    PropertiesDeploy propertiesDeploy = new PropertiesDeploy();
    propertiesDeploy.init();

    WebAccount account = new WebAccount();
    setWebAccount(type, account);
    Clickoo_message message = new MessageService().selectMessageById(Long.parseLong(mid));
    Body body =
        (Body)
            new DLEMailSupport()
                .dlMail(null, Constant.DOWNLOAD_BODY, message, account, null, null, mid);
    System.out.println(body);
  }
Ejemplo n.º 3
0
 /**
  * 测试下载整封邮件.
  *
  * @throws MessagingException
  */
 @Test
 public void testDlEmail() throws MessagingException {
   PropertiesDeploy propertiesDeploy = new PropertiesDeploy();
   propertiesDeploy.init();
   WebAccount account = new WebAccount();
   setWebAccount(type, account);
   Clickoo_message message = new MessageService().selectMessageById(Long.parseLong(mid));
   new PropertiesDeploy().init();
   EmailCacheObject emailCache = EmailCacheManager.get(mid);
   if (emailCache == null) {
     emailCache = new EmailCacheObject();
   } else if (emailCache.getData() != null) {
     emailCache.setData(null);
     emailCache.setData_size(0);
   }
   Email email =
       (Email)
           new DLEMailSupport()
               .dlMail(emailCache, Constant.DOWNLOAD_EMAIL, message, account, null, "2", mid);
   System.out.println(email.getFrom());
   //		System.out.println(email.getBody());
   System.out.println(email.getAttachList().size());
 }
Ejemplo n.º 4
0
  /**
   * 测试下载单封附件.
   *
   * @throws MessagingException
   */
  @Test
  public void testDlAttachment() throws MessagingException {
    System.out.println(EmailCacheManager.removeEmail(mid));
    PropertiesDeploy propertiesDeploy = new PropertiesDeploy();
    propertiesDeploy.init();

    WebAccount account = new WebAccount();
    setWebAccount(type, account);
    //		Clickoo_message message = new MessageService().selectMessageById(Long.parseLong(mid));
    new PropertiesDeploy().init();
    WebEmail webEmail = new WebEmail();
    WebEmailhead header = new WebEmailhead();
    header.setMessageId(mid);
    webEmail.setHead(header);
    WebEmailattachment attach = new WebEmailattachment();
    attach.setName("373_193_test");
    attach.setSize(166736);
    attach.setType("txt");
    attach.setIsdown("0");
    webEmail.setAttach(new WebEmailattachment[] {attach});
    //		Clickoo_message_attachment a = (Clickoo_message_attachment) new
    // DLEMailSupport().dlMail(null, Constant.DOWNLOAD_ATT, message, account, webEmail, "2", mid);
    //		System.out.println(a.getIn());
  }