Download Gmail Mail Content with R

I am trying to download gmails from my gmail account. Most importantly, I am interested in downloading the actual contents of the mail along with a different time of receipt, subject, address and address. I tried using gmailr and edeR packages. Although gmailr helps in sending emails (which I tried successfully, edeR helps in downloading only the line data, not the message body. I am looking for this data to check the classification model. Is there any way to do this in R ... I am not familiar with which or in another language.

+4
source share
1 answer

You can manually extract the archive of your gmail and use it convert_mbox_eml()from the package tm.plugin.mailto convert .mbox(several letters in one window) to the format eml(each mail in one file), and then download it VCorpususing readMail:

library(tm)
library(tm.plugin.mail)

mail <- paste0(getwd(), "/mail")
convert_mbox_eml("yourarchive.mbox", mail)
vc <- VCorpus(DirSource(mail), readerControl = list(reader = readMail))
+9
source

Source: https://habr.com/ru/post/1614314/


All Articles