diff examples/test.ur @ 0:33bf7ee17644

Initial import from some old code
author Adam Chlipala <adam@chlipala.net>
date Sat, 03 Mar 2012 14:59:04 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/test.ur	Sat Mar 03 14:59:04 2012 -0500
@@ -0,0 +1,31 @@
+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>