3

I'm trying to set up the mailR package to send me email notifications when my scripts have finished running. So far, I've installed and loaded the package, installed the latest version of Java that matches my architecture and ran the following code:

email <- send.mail(from = sender, to = recipients, subject = "Test", body = "This is a test", 
         smtp = list(host.name = "smtp.mail.com", port = 587, user.name = sender, 
         passwd = pw), authenticate = T, send = F)

Where sender, recipients and pw are predefined character vectors.

This works fine and produces a Java object. However when I go to send the email with

email$send()

I get the following error message

Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  : 
  java.lang.NoClassDefFoundError: javax/activation/DataHandler

I know nothing about Java so have no idea how to interpret this and fix it. Any help would be appreciated.

Tim Hargreaves
  • 292
  • 3
  • 11
  • Start by putting the error message into a search engine. And Stultuske is right - you are engaging in **advanced** java topics already. Without knowing anything about java basics ... won't work out most likely. – GhostCat Jan 15 '18 at 13:19
  • 2
    I just want to send an email to notify me of the completion of my R scripts. Are you suggesting I learn a whole new programming language in order to achieve that? From what I can tell there isn't a simpler way to send an email through R and the package documentation has no mention of errors like this, it should usually just work so I was hoping it would just be a small tweak and then I'll have it running and then I'll never need to look into Java again. – Tim Hargreaves Jan 15 '18 at 13:27

0 Answers0