Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2013
    Posts
    2
    Rep Power
    0

    Default Can someone please please help !!!

    I am working on a code to search my email by subject and download attachment. Below is the code which I tried in 2 ways
    but found returns 0. Can some one please help. Also I need to search if email has attachment as .xls.
    I am using gmail pop3


    SearchTerm st = new SearchTerm()//XT_
    {
    @Override
    public boolean match(Message message) {
    try
    {
    if(message.getSubject().contains("XT_"))
    {
    return true;
    }
    }catch(MessagingException ex) {
    ex.printStackTrace();
    }
    return false;

    }

    };
    Message[] found = folderInbox.search(st);//returns 0

    2) SubjectTerm bodyTerm = new SubjectTerm("XTIME_");

    System.out.println("Searching for BodyTerm with keyword = "+ "XTIME_ ");

    Message[] found = folderInbox.search(bodyTerm); // found returms 0
    Reply With Quote

  2. #2
    sehudson's Avatar
    sehudson is offline Senior Member
    Join Date
    Mar 2010
    Posts
    354
    Rep Power
    5

    Default Re: Can someone please please help !!!

    Try putting some print line statements in your code to see what various variables are at certain points within the program as a means of debugging your code.
    That may give you a better idea as to why you are not getting the output you expect.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •