Learn R Programming

edeR (version 1.0.0)

extractBetween: Extracts eamil within given date range

Description

This function extracts email data from a specified folder with given date range

Usage

extractBetween(username, password, folder, startDate, endDate, nmail = -1)

Arguments

username
A character string of email address for example, "xxx@gmail.com"
password
A character string of password of the email address for example "xyz123"
folder
A character string of folder or label name from where we want to extract email data
startDate
A character starting of date (e.g "06-Jun-2013") of interest of the date range. The format of date should be same as shown in the example, any other format will give error
endDate
A character string of end date (e.g. "06-Jun-2013")of interest of the date range
nmail
An integer for the number of emails to extract, default is all emails (nmail=-1)

Value

n_message
Number of available email in the specified folder
data
The extracted data frame with the field unique id (uid), sender (from), receiver either direct or cc'd (to), subject of mail (subj), time stamp (datetime)

Details

This function is able to extract emails from any specified folder within a given date range. To extract "Sent Mail" or "Drafts" we have to specify the argument differently. To extract "Sent Mail", the argument is folder="[Gmal]/Sent Mail"

See Also

extractMbox

Examples

Run this code
## Not run: 
# # To extract maximum of 5 emails from inbox between June 6, 2013 to June 6, 2013
# dat <-extractBetween(username="username@gmail.com",
#                      password="password",
#                      folder="INBOX",
#                      startDate="06-Jun-2013",
#                      endDate="06-Jun-2013",
#                      nmail=5)## End(Not run)

Run the code above in your browser using DataLab