Mercurial > email
view examples/test.ur @ 9:8966edef462a
Add more uw_strdup, which seems to avoid problems from reuse of memory
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Thu, 04 Feb 2016 17:50:25 -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>