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