# NOT RUN {
# }
# NOT RUN {
# configure IMAP
library(mRpostman)
imapconf <- configure_imap(url="imaps://your.imap.server.com",
username="your_username",
password=rstudioapi::askForPassword()
)
# copy search results from "Sent" to "INBOX"
results <- imapconf %>%
select_mailbox(mbox = "Sent") %>%
search_before(date_char = "10-may-2012") %$% #exposition pipe operator - pass two argg
move_msg(imapconf = imapconf, msg_id = msg_id, to_mbox = "Other Mailbox")
# the same result can be achieved with a combination of:
results <- imapconf %>%
select_mailbox(mbox = "Sent") %>%
search_before(date_char = "10-may-2012") %$% #exposition pipe operator - pass two argg
copy_msg(imapconf = imapconf, msg_id = msg_id, to_mbox = "Other Mailbox") %$%
add_flags(imapconf = imapconf, msg_id = msg_id, flags_to_set = "Deleted") %$%
expunge()
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab