title: shiny send emails with attachment based on the email address input
body: <p>I have many word documents using email address as the file name, for instance,</p>
  <p>username@gmail.com.docx</p>
  <p>I would like to make a shiny app so that the customers could input their own email address, and get an email send by the app with an attachment of his own docx file. Here is what I have so far (updated):</p>
  <pre><code>library(shiny)
  library(mailR)
  
  ui=fluidPage(
    titlePanel('feedbacks'),
    sidebarPanel(
      textInput('email',label='email address'),width = 3,
      actionButton('go',label='send me email')
      )
  )
    
  
  server &lt;- function(input, output, session) {
     
    observeEvent(input$go,{
       withProgress(message = &quot;please wait&quot;, {
         Sys.sleep(1) 
         setProgress(0.25, detail = &quot;1 Sec&quot;)
         Sys.sleep(1) 
         setProgress(0.5, detail = &quot;2 Sec&quot;)
         Sys.sleep(1) 
         setProgress(0.75, detail = &quot;3 Sec&quot;)
         Sys.sleep(1) 
         setProgress(1, detail = &quot;4 Sec&quot;)
       
         isolate({
           fullnames=list.files(path = &quot;/Users/Desktop/test&quot;, pattern = &quot;.docx&quot;); 
           
           reactive({
             input$email=gsub(pattern = '\\.docx','',fullnames); 
             send.mail(from='username@foxmail.com',
                       to=input$go,
                       subject='feedbacks',
                       body=c(' '), 
                       smtp=list(host.name='smtp.qq.com',
                                 port=465,                          
                                 user.name='username',    
                                 passwd='password',            
                                 ssl=T),  
                       authenticate = T,
                       send = T,
                       attach.files = input$datapath
             )
           })
         })
         
         })
       showNotification(&quot;message sent&quot;, type = &quot;message&quot;, duration = 10)
       
  
    })
  }
  
  shinyApp(ui,server)
  </code></pre>
  <p>and there is no error and no response. Any suggestion or experience?</p>