View Category

Check your language appears on the site

Your language name should appear within the HTML found at the main page.
val url = "" ; val language = "scala" ; val srchexp = url + language;

val source = Source.fromURL(url).getLines

while (source.hasNext) if ( printf("Language %s exists @ %s\n", language, url)

Send an email

Use library functions, classes or objects to create a short email addressed to your own email address. The subject should be, "Greetings from", and the user should be prompted for the message body, and whether to cancel or proceed with sending the email.
// requires Java Mail API (mail.jar), which must be in classpath

import javax.mail._
import javax.mail.internet._
import java.util.Properties._

// Get the user's message
println("Enter the text you wish to send in the message (hit Ctrl-D to finish):")
var bodyText = ""
var line = readLine
while (line != null) {
bodyText += line
line = readLine

// Confirm they want to send
println("Are you sure you want to send the message? [y/N]")
val yesOrNo = readLine
if (yesOrNo != "y" && yesOrNo != "Y") {

// Set up the mail object
val properties = System.getProperties
properties.put("", "localhost")
val session = Session.getDefaultInstance(properties)
val message = new MimeMessage(session)

// Set the from, to, subject, body text
message.setFrom(new InternetAddress(""))
message.setRecipients(Message.RecipientType.TO, "")
message.setSubject("Greetings from")

// And send it
Need a code t send email from smtp server in scala