I'm trying to send an email with the Microsoft365R package. There's an embedded image I need in it. I've tried two ways:
library(Microsoft365R)
emails <- c("myemail@example.com")
for(i in emails){
my_outlook <- get_business_outlook()
my_email <- my_outlook$create_email()$
set_body("<img src=`https://raw.githubusercontent.com/iagocnunes/test/main/002.png` alt=`image`>", content_type="html")$
set_subject("Test")$
set_recipients(to = i)$
send()
}
And:
for(i in emails){
my_outlook <- get_business_outlook()
my_email <- my_outlook$create_email()$
set_body("<b>test testing", content_type="html")$
add_image("https://raw.githubusercontent.com/iagocnunes/test/main/002.png")$
set_subject("Test")$
set_recipients(to = i)$
send()
}
In both the image fails to embed. Why is this happening and how can I get it right?