File: e-mail.e

package info (click to toggle)
entity 1.0.1-8
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 5,604 kB
  • ctags: 5,394
  • sloc: ansic: 64,242; sh: 7,377; makefile: 776; perl: 319
file content (32 lines) | stat: -rw-r--r-- 853 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env entity

<object>
  <window position="center" title="Mailer" ondelete="entity:exit">
    <frame border="3" title="Mailer" expand="true">
	  <halign>
	    <label text="To:" width="60"/>
	    <entry name="to" expand="true"/>
	  </halign>
	  <halign>
	    <label text="Subject:" width="60"/>
	    <entry name="subject" expand="true"/>
	  </halign>
	  <scrollwindow expand="true">
	    <text name="body" editable="true"> </text>
	  </scrollwindow>
	  <button label="Mail it!" onclick="mailit"/>
    </frame>
  </window>
  <perl><![CDATA[
    sub mailit {
		$to= enode("entry.to")->attrib("text");
		$subject= enode("entry.subject")->attrib("text");
		$body= enode("text.body")->get_data();
		open(OUT,"| /bin/mail -s '$subject' $to");
		print OUT "$body\n";
		close(OUT);
		
		enode ("object")->call ("entity:exit");
	}
  ]]></perl>
</object>