title: Send mail with gmail and R
body: <p>I am simply trying to send an email with R through my gmail account using the mailR package but it does not seem to work.</p>
  
  <p>I get this error:</p>
  
  <blockquote>
  <pre><code>Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  : 
    org.apache.commons.mail.EmailException: Sending the email to the following server failed : aspmx.l.google.com:25
  </code></pre>
  </blockquote>
  
  <p>Below is the code with anonymized gmail adresses.</p>
  
  <pre><code>install.packages("mailR")
  library(mailR)
  sender &lt;- "sender@gmail.com"  # Replace with a valid address
      recipients &lt;- c("receiver1@gmail.com")  # Replace with one or more valid addresses
      email &lt;- send.mail(from = sender,
                         to = recipients,
                         subject="Subject of the email",
                         body = "Body of the email",
                         smtp = list(host.name = "aspmx.l.google.com", port = 25),
                         authenticate = FALSE,
                         send = FALSE)
  
  
      email$send() # execute to send email
  </code></pre>