mailR HTML tables not rendering properly in email

I've created a quick report of tables that I want to email out on a regular basis. When I knit the HTML file it looks like this:

However, when I email it all the borders disappear:

My markdown code looks like:

---
title: "Email Test"
output: html_document
---

## Hello world!

```{r setup, include=FALSE, echo=FALSE}
suppressPackageStartupMessages(library(tidyverse))
suppressPackageStartupMessages(library(kableExtra))

### Table 1:
```{r ResponseBoard, include=TRUE, echo=FALSE, results='asis'}

head (mtcars, 10) %>% 
  rownames_to_column(var = "car") %>% 
  select (cyl, car, mpg, disp, hp) %>% 
  arrange (cyl) %>% 
  kable (escape = FALSE, 
         align = "clccc") %>% 
  kable_styling(c("bordered")) %>% 
  column_spec(1:5, color = "black") %>% 
  collapse_rows(columns = 1, valign = "middle") 
  

And my mailR code looks like:

# compile using rmarkdown
library(rmarkdown)
library(knitr)
rmarkdown::render("C:/Users/grousell/OneDrive - Grand Erie DSB/Surveys/2018-19/Student Census/Data Collection/Email_Test.Rmd")

library(mailR)

send.mail(from = "greg.rousell@granderie.ca",
          to = "greg.rousell@granderie.ca", # 
          subject = "TEST EMAIL",
          html = TRUE,
          inline = FALSE,
          body = "Email_Test.html",
          authenticate = TRUE,
          smtp = list(host.name = "smtp.office365.com", 
                      port = xxx,
                      user.name = "my.name@myorg.ca", 
                      passwd = "xxxxxxxxxxxxx", 
                      tls = TRUE)
          )

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.