Send email: Difference between revisions
Content added Content deleted
(factor email example actually works now) |
(→{{header|TXR}}: Modernize: no @(next "-") for standard input, or "!mail" for piping. Some mail programs don't have -c option for CC.) |
||
Line 1,262: | Line 1,262: | ||
=={{header|TXR}}== |
=={{header|TXR}}== |
||
<lang txr>#!/usr/bin/txr |
<lang txr>#!/usr/bin/txr |
||
#!/usr/bin/txr |
|||
@(next :args) |
@(next :args) |
||
@(cases) |
@(cases) |
||
Line 1,274: | Line 1,275: | ||
@ (throw error "must specify at least To and Subject") |
@ (throw error "must specify at least To and Subject") |
||
@(end) |
@(end) |
||
@(next |
@(next *stdin*) |
||
@(collect) |
@(collect) |
||
@BODY |
@BODY |
||
@(end) |
@(end) |
||
@(output ` |
@(output (open-command `mail -s "@SUBJ" -a CC: "@CC" "@TO"` "w")) |
||
@(repeat) |
@(repeat) |
||
@BODY |
@BODY |
||
@(end) |
@(end) |
||
. |
. |
||
@(end) |
@(end)</lang> |
||
</lang> |
|||
{{out}} |
|||
Test run: |
|||
<pre>$ ./sendmail.txr linux-kernel@vger.kernel.org "Patch to rewrite scheduler #378" |
<pre>$ ./sendmail.txr linux-kernel@vger.kernel.org "Patch to rewrite scheduler #378" |
||
Line 1,303: | Line 1,303: | ||
{{omit from|zkl}} |
{{omit from|zkl}} |
||
{{omit from|ZX Spectrum Basic|Does not have network access.}} |
{{omit from|ZX Spectrum Basic|Does not have network access.}} |
||
=={{header|VBScript}}== |
=={{header|VBScript}}== |