Learn R Programming

mRpostman (version 0.3.1)

get_attachments: Get Attachments

Description

Get attachments after fetching full messages.

Usage

get_attachments(msg_list, content_disposition = "both")

Arguments

msg_list

A list containing the full messages fetched from the server after using fetch_full_msg.

content_disposition

A string indicating which type of "Content-Disposition" attachments should be retireved. Default is "both", which retireves regular attachments ("Content-Disposition: attachment") and inline attachments ("Content-Disposition: inline").

Value

A logical TRUE if the attachments extraction was successful.

References

Troost, R., Dorner, S., and K. Moore, Ed., Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field, RFC 2183, DOI 10.17487/RFC2183, August 1997, https://www.rfc-editor.org/info/rfc2183.

See Also

Other attachments: list_attachments

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
# configure IMAP
library(mRpostman)
imapconf <- configure_imap(url="imaps://your.imap.server.com",
                           username="your_username",
                           password=rstudioapi::askForPassword()
                          )

# extracting attachments
imapconf %>%
    select_mailbox(mbox = "TAM") %>%
    search_before(date_char = "10-may-2012", by = "UID") %$% #exposition pipe - two argg
    fetch_full_msgs(imapconf = imapconf, msg_id = msg_id) %>%
    get_attachments()

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab