title: Email dataframe as table in email body with SendMailR
body: <p>I am trying to send a dataframe with SendMailR.  I can send it as an attachment with reasonably good formatting.  However I would like to send the dataframe in the body of the email.  I tried capture.output, print, sprintf but am not even able to get the format close.</p>
  
  <p>e.g. I tried the following syntax</p>
  
  <pre><code>for (i in 1:nrow(df)){
   MSG = c(MSG,rownames(df)[1],as.character(unlist(df[i,])),'\n')
  } 
  MSG = sprintf('%-10s',MSG)
  sendmail(from,to,subject,msg = list(MSG,attachment1,attachment2 ... ))
  </code></pre>
  
  <p>In other words, I am thinking that it might be necessary to convert my dataframe into a format with /n and sprintf('s-10%') etc and store it in MSG.  Can someone point me in the right direction?</p>