... I have a web-based R app which has 5 tabs for outcomes. The users can download any of these outcomes by clicking on download button but if a user forgets to download, the information cannot be retrieved. One option is to send the result to one email (either admin or users). Would you please let me know if there is a way that the results can be sent to an email?
I searched for that and found the following instruction. But 1) it is for sending a message not the outcome of the shiny app, and 2) the error is “cannot open the connection”.
Thanks
Ui.R
shinyUI(pageWithSidebar(
headerPanel("Email sender"),
sidebarPanel(
textInput("from", "From:", value="from@gmail.com"),
textInput("to", "To:", value="to@gmail.com"),
textInput("subject", "Subject:", value=""),
actionButton("send", "Send mail")
),
mainPanel(
aceEditor("message", value="write message here")
)
))
Server.R
library(shinyAce)
library(sendmailR)
shinyServer(function(input, output, session) {
observe({
if(is.null(input$send) || input$send==0) return(NULL)
from <- isolate(input$from)
to <- isolate(input$to)
subject <- isolate(input$subject)
msg <- isolate(input$message)
sendmail(from, to, subject, msg)
})
})