How does one add standard Java libraries to SBT. For example, my class relies on these imports:
import javax.mail._
import javax.mail.internet._
import java.util.Properties
Trying to compile with SBT fails if I use these, for example:
[error] /Users/jacobus/scalaprojects/doxy/src/main/scala/EmailService.scala:6: expected class or object definition
[error] val props = new Properties();
Here's the source:
import java.util.Properties
import javax.mail._
import javax.mail.internet._
val props = new Properties();
props.put("mail.smtp.host", "localhost");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable","true");
props.put("mail.debug", "true");
val session = Session.getInstance(props);
val message = new MimeMessage(session);
message.setFrom(new InternetAddress("[email protected]"));
message.setRecipients(Message.RecipientType.TO, "[email protected]");
message.setSubject("This is the Subject");
message.setText("This is the Message");
val transport = session.getTransport("smtp");
transport.connect("localhost","username","password")
Transport.send(message);