Closed ccampb17 closed 3 years ago
We're currently experiencing the same issue which seems to have popped up out of nowhere. I think the only real difference is that we're attempting to send mail from an office365 smtp site rather than a gmail one.
Very interested in what could have happened here?
+1
@rpremraj Please advise
I had the same issue. For me this was related to the deprecation of TLS v1 and TLSv1.1 in java 1.8 8u291
see https://www.oracle.com/java/technologies/javase/8u291-relnotes.html
You can re-enable them by removing them from jdk.tls.disabledAlgorithms
in the java security file (for me this is /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security )
but the (better, from a security POV at least) approach I ended up using was forcing apache commons mail (which mailR is a wrapper around) to use TLSv1.2 by setting a java system property:
rJava::.jinit()
rJava::.jcall("java/lang/System","S","setProperty", "mail.smtp.ssl.protocols", "TLSv1.2")
mailR::send.mail(...)
I'm using STARTTLS and you might need something slightly different if you are using TLS wrapper
Thanks, @dseynaev this realy helps
@dseynaev telling java to use 1.2 via an rJava call worked like a charm. Thanks buddy!
@dseynaev thank you - this worked like a charm! I had a feeling some java had gone weird somewhere.
Now I can switch back to mailR instead of the intricate and unreliable workaround I made last week :)
Thanks again!
I know that this issue has been fixed, but through this I realized that mailR doesn't seem to be actively maintained anymore. My team switched over to Blastula, https://github.com/rstudio/blastula, and we're very happy with the change. It's maintained by RStudio themselves, and doesn't rely on Java to send SMTP messages, so less system configuration is needed to get it to work correctly.
@mmccarthy-bnt thank you for this recommendation! Blastula looks really great - I have added switching over to it to my to do list.
Weirdly though, I have one particular case where I need something that can send non-HTML emails. Since mailR plus the solution from @dseynaev does this very well, I guess I will be still using it for the time being.
Hello,
I've been using mailR for a long time with no issues - however, last week it suddenly stopped working and I cannot work out why. It uses a gmail address, so I have enabled the 'less secure apps' access (again it was working great until last week).
I've tried combinations of switching ports, TLS/SSL on and off, nothing seems to work.
I can still use the code to send mails on a windows 10 machine.
Any help is much appreciated as mailR is much better than the alternatives... when it was working at least.
For reference, I provide the error message, code used to generate it, and my sessionInfo in that order below. Please let me know if any other info would be useful.
The (verbose) error message is as follows:
Here is the code used to send the mail
and the sessioninfo: