title: How do I send emails through Outlook using R?
body: <p>I'm trying to send myself an email through R, and I have an Outlook account (my email address ends in @hotmail.com).</p>
  <pre><code>library(mailR)
  
  PASS &lt;- as.character(&quot;XXXXXXXXXX&quot;)
  
  sender &lt;- &quot;amalik34@hotmail.com&quot;
  recipients &lt;- c(&quot;amalik34@hotmail.com&quot;)
  send.mail(from = sender,
                     to = recipients,
                     subject=&quot;Subject of the email&quot;,
                     body = &quot;Body of the email&quot;,
                     smtp = list(host.name = &quot;smtp-mail.outlook.com&quot;, port = 25, user.name=&quot;amalik34&quot;, passwd=PASS, ssl=TRUE),
                     authenticate = TRUE,
                     send = TRUE)
  </code></pre>
  <p>Which returns this error:</p>
  <blockquote>
  <p>java.lang.NoClassDefFoundError: javax/activation/DataHandler  at
  org.apache.commons.mail.Email.createMimeMessage(Email.java:1832)  at
  org.apache.commons.mail.Email.buildMimeMessage(Email.java:1268)   at
  org.apache.commons.mail.Email.send(Email.java:1436)   at
  java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
  Method)   at
  java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
  at
  java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.base/java.lang.reflect.Method.invoke(Method.java:567)   at
  RJavaTools.invokeMethod(RJavaTools.java:386) Caused by:
  java.lang.ClassNotFoundException  at
  RJavaClassLoader.findClass(RJavaClassLoader.java:397)     at
  java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:586)   at
  java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)   ... 8
  more NULL Error: NoClassDefFoundError (Java):
  javax/activation/DataHandler</p>
  </blockquote>
  <p>I have no idea what's causing this error or what I'm doing wrong. I see gmail users doing pretty much the exact same steps I'm trying and they don't have any problems.</p>