5

I have a no-reply email that gets sent to me every hour with a spreadsheet with alerts notifying me when performance is down. The table looks as follows:

enter image description here

Is it possible to call the body of this email from Microsoft Outlook into R? I basically want to call out this table (which changes every hour). So currently I think the best way to do it is by calling the most recent email with the name of the subject because the subject never changes. From there I want to manipulate what I need in R, I just don't know how to make the connection from the body of a Microsoft Outlook email into R.

Any help would be great and I know this is kind of a strange question.

Thanks!

R Guru
  • 171
  • 1
  • 12
  • How many of these already answered questions have you read and attempted http://stackoverflow.com/search?q=%5Br%5D+outlook? – Pierre L Jan 25 '16 at 20:03
  • why involve outlook at all? mailboxes can be "virtual" and simply be an application that accepts the mail, and there's plenty of other utilities can grab/check mailboxes and do stuff automatically. – Marc B Jan 25 '16 at 20:04
  • @PierreLafortune I have looked through that and there is not an answer to my question in those options – R Guru Jan 25 '16 at 20:11
  • 1
    I think you can use a command line email client, make a scheduled system call and scrape the html email the way you prefer to do it for web pages. – AlexT Jan 25 '16 at 20:50

2 Answers2

0

You can hit the Outlook Rest API directly from R and import the data into a dataframe using a variety of libraries.

Outlook Rest API Reference for Mail: https://msdn.microsoft.com/office/office365/api/mail-rest-operations

Stack Overflow answer for parsing Json: Parse JSON with R

Community
  • 1
  • 1
David Crook
  • 2,722
  • 3
  • 23
  • 49
0

You can do a loop with the library(tm.plugin.mail) or a function to import it like a dataframe

Neil
  • 14,063
  • 3
  • 30
  • 51