×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Scala
Posted by: marcus bui
Added: Dec 23, 2014 7:31 AM
Views: 15
  1. def buildMimeMessage(to: String, from: String, subject: String, msg: String, setup: ServerSetup): MimeMessage = {
  2.     val session: Session = getSession(setup);
  3.     val mimeMessage: MimeMessage = new MimeMessage(session);
  4.     mimeMessage.setSubject(subject);
  5.     mimeMessage.setFrom(new InternetAddress(from));
  6.     mimeMessage.setText(msg);
  7.     mimeMessage
  8.     //Transport.send(mimeMessage, new InternetAddress[] {new InternetAddress(to)});
  9.   }