Need help in writing a simple line chart and then sending the chart over email

Step #1: need help in writing a simple line chart and then sending the chart over email.

eventually I need the data to come from MySQL but those are next steps once Step#1 works

library(plotly)
library(htmlwidgets)

p <- plot_ly(
  type = "scatter",
  x = 1:10,
  y = 1:10,
  mode = "lines"
)

print(p)

saveWidget(p, file = "myPlot.html", selfcontained = TRUE)
message("saved html file to: ", file.path(getwd(),"myPlot.html"))