view examples/test.ur @ 8:fe6049d23ce5

Adding charset=utf-8
author Adam Chlipala <adam@chlipala.net>
date Thu, 04 Feb 2016 13:01:33 -0500
parents 33bf7ee17644
children
line wrap: on
line source
fun sendPlain r =
    Mail.send (Mail.from r.From (Mail.to r.To (Mail.subject r.Subject Mail.empty)))
              r.Body None;
    return <xml>Sent</xml>

fun sendHtml r =
    Mail.send (Mail.from r.From (Mail.to r.To (Mail.subject r.Subject Mail.empty)))
              r.Body (Some <xml><a href={url (main ())}>Spread the love!</a></xml>);
    return <xml>Sent</xml>

and main () = return <xml><body>
  <h2>Plain</h2>

  <form>
    From: <textbox{#From}/><br/>
    To: <textbox{#To}/><br/>
    Subject: <textbox{#Subject}/><br/>
    Body: <textarea{#Body}/><br/>
    <submit action={sendPlain}/>
  </form>

  <h2>HTML</h2>

  <form>
    From: <textbox{#From}/><br/>
    To: <textbox{#To}/><br/>
    Subject: <textbox{#Subject}/><br/>
    Body: <textarea{#Body}/><br/>
    <submit action={sendHtml}/>
  </form>
</body></xml>