0

I tried to crawl my email data by using 'edeR' package. I succeeded in getting 'inbox' folder, but failed to get 'sent mail'. Here are the codes.

Sys.setenv(JAVA_HOME="C:/Program Files/Java/jre1.8.0_121")
library(rJava)
library(edeR)
mail_sen<-extractBetween(username="xxxx@gmail.com",
                     password="xxxxx", folder="[Gmail]/Sent Mail",
                     startDate="06-Jan-2017", endDate="06-Mar-2017", nmail=5)

When I change (folder="[Gmail]/Sent Mail") into (folder="inbox"), it works. However, when I use the code above, error comes.

Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  : 
  Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\Java\jre1.8.0_121\lib\ext\jython.jar\Lib\imaplib.py", line 749, in uid
imaplib.error: command SEARCH illegal in state AUTH

I'm stuck in this error... Anyone who can solve this problem?

Minji Kim
  • 1
  • 1

1 Answers1

0

the error is not very informative but this post suggests it means that it can't find your folder: edeR seems to be a wrapper around the imaplib Python library that is referenced in that question. According to the answers, the name of the "Sent Mail" folder is language-dependent.

So i think you might have to try different translations of "Sent Mail" in folder="[Gmail]/Sent Mail"

eta: i do not recommend changing your gmail language settings to see what happens to the "Sent Mail" folder name to a language you do not speak. I just spent five minutes finding out which option under the little cogwheel in gmail meant "settings" in Bahasa Indonesia.

Community
  • 1
  • 1
Janna Maas
  • 1,124
  • 10
  • 15
  • I changed the language settings from Korean to English, and it works!!! Thank you for the nice answer:) – Minji Kim Apr 29 '17 at 16:14