-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SMTP support #177
Comments
Hmm we would need to mimic this example: https://curl.haxx.se/libcurl/c/smtp-mail.html |
Hmm this is pretty difficult. I support for vector options (that we need for curlopt_mail_rcpt) in the smtp branch: remotes::install_github("jeroen/curl@smtp") And then you can try something like this: library(curl)
h <- new_handle(verbose = TRUE, mail_from = "Sender <sender@ocpu.io>",
mail_rcpt = "Jeroen Ooms <jeroenooms@gmail.com>")
con <- file("body.txt", open = 'rb')
handle_setopt(h, readfunction = function(nbytes, ...) {
cat("reading", nbytes, "bytes\n")
buf <- readBin(con, raw(), nbytes)
}, upload = TRUE)
res <- curl::curl_fetch_memory('smtp://localhost', handle = h) But the emails keeps bouncing for me, not sure what I do wrong. |
Actually, your example worked for me when I used my organization's SMTP server! I didn't try it with gmail or localhost. |
Hi, I've just tried this using Gmail and it worked fine for me! Thanks, Andrew. |
Hi @jeroen, I'm using this feature routinely now. Any chance we can get this merged into |
curl::send_mail() is in master |
Fix in curl 4.0 on CRAN now. |
Brilliant. Thanks. |
Curl apparently supports email sending via SMTP:
Where
mail.txt
has content e.g.Is this possible to do with with this package? It seems like most of these options exists, with the exception of
--upload-file
. There is anupload
option incurl_options
but it expects an integer value, so I'm not sure how to use it.The text was updated successfully, but these errors were encountered: