View Category

Check your language appears on the langref.org site

Your language name should appear within the HTML found at the http://langreg.org main page.
fsharp
let httpReq = (WebRequest.Create(url) :?> HttpWebRequest)
httpReq.KeepAlive <- false
let httpStream = new StreamReader(httpReq.GetResponse().GetResponseStream())
let htmlPage = httpStream.ReadToEnd()
httpStream.Close()

let offerStatus = (if (htmlPage.IndexOf(url ^ language) > 0) then "offers" ; else "does not offer")
Console.WriteLine("{0} {1} {2}", url, offerStatus, language)

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 langref.org", and the user should be prompted for the message body, and whether to cancel or proceed with sending the email.
fsharp
open System
open System.Net
open System.Net.Mail
open System.Net.Mime

let subject = "Greetings from langref.org"
let from = "username@gmail.com"
let destination = "username@gmail.com"

printfn "Write mail body (press 'Enter' when finished):"
let mutable body = Console.ReadLine()
if body = null || body.Length = 0 then
body <- "Hello World"

let mail = new MailMessage(from, destination, subject, body)

let smtpHost = "smtp.gmail.com"
let clientCredentials = new NetworkCredential("username@gmail.com", "password")
let smtpClient = new SmtpClient(smtpHost,587)
smtpClient.EnableSsl <- true
smtpClient.UseDefaultCredentials <- false
smtpClient.Credentials <- clientCredentials

printfn "Send email? y/n"
match Console.ReadLine() with
| "y" -> smtpClient.Send(mail);mail.Dispose();printfn "email delivered"
| "n" -> smtpClient.Dispose()
| _ -> smtpClient.Dispose()