blastula icon indicating copy to clipboard operation
blastula copied to clipboard

An attachment with non-Ascii characters in the filename breaks blastula::smtp_send

Open OssiLehtinen opened this issue 4 years ago • 0 comments

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.

OssiLehtinen avatar Feb 18 '21 18:02 OssiLehtinen