annotate 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
rev   line source
adam@0 1 fun sendPlain r =
adam@0 2 Mail.send (Mail.from r.From (Mail.to r.To (Mail.subject r.Subject Mail.empty)))
adam@0 3 r.Body None;
adam@0 4 return <xml>Sent</xml>
adam@0 5
adam@0 6 fun sendHtml r =
adam@0 7 Mail.send (Mail.from r.From (Mail.to r.To (Mail.subject r.Subject Mail.empty)))
adam@0 8 r.Body (Some <xml><a href={url (main ())}>Spread the love!</a></xml>);
adam@0 9 return <xml>Sent</xml>
adam@0 10
adam@0 11 and main () = return <xml><body>
adam@0 12 <h2>Plain</h2>
adam@0 13
adam@0 14 <form>
adam@0 15 From: <textbox{#From}/><br/>
adam@0 16 To: <textbox{#To}/><br/>
adam@0 17 Subject: <textbox{#Subject}/><br/>
adam@0 18 Body: <textarea{#Body}/><br/>
adam@0 19 <submit action={sendPlain}/>
adam@0 20 </form>
adam@0 21
adam@0 22 <h2>HTML</h2>
adam@0 23
adam@0 24 <form>
adam@0 25 From: <textbox{#From}/><br/>
adam@0 26 To: <textbox{#To}/><br/>
adam@0 27 Subject: <textbox{#Subject}/><br/>
adam@0 28 Body: <textarea{#Body}/><br/>
adam@0 29 <submit action={sendHtml}/>
adam@0 30 </form>
adam@0 31 </body></xml>