blastula
blastula copied to clipboard
An attachment with non-Ascii characters in the filename breaks blastula::smtp_send
Hello,
If I attach a file with, for example, an 'Ä' in the filename, blastula fails to send the email via smtp.
An example:
email <-
blastula::compose_email(
body = blastula::md(c("Hello, example!")
)
)
readr::write_csv(mtcars, "Äfile.csv")
# Add an attachment
email <- blastula::add_attachment(email, "Äfile.csv")
# Send via smtp
blastula::smtp_send(email,
to = "[email protected]",
from = "[email protected]",
subject = paste0("My subject"),
credentials = ccreds)
This results in the error message:
Error in curl_fetch_memory(smtp_server, handle = h) : Failure when receiving data from the peer
One can of course try to avoid problematic characters in file names, but sometimes it is not feasible to edit the filenames before attaching.